<code-playground>
A standalone web component for live HTML, CSS, and JavaScript editing with sandboxed preview, runtime console, and CodePen export.
Features
Live Preview
Debounced auto-run updates the sandboxed iframe as you type.
Manual Run
Opt into explicit run mode for scripts that shouldn't auto-execute.
Runtime Console
Bridged console with log levels, search, repeat collapsing, and origin tracking.
External Sources
Load HTML, CSS, JS, and head fragments from external files.
Dark Mode
Auto-detects page theme or set explicitly via the mode attribute.
CodePen Export
One-click export opens the current playground state in CodePen.
Fully Themeable
CSS custom properties and shadow parts for deep customization.
Persistence
localStorage persistence for source, active tab, and split position.