Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


  Here's a demo of our experimental "attachEffect". We are now able to attach "side effects" to property value changes, from inside the component and outside.
  Check the two calls to "attachEffect" and observe the console log on your dev tools as you click the button.
<p>Give the project your feedback on <a target="_blank" href="">GitHub</a></p>


                div {
  font-size: larger;


                import { WebComponent, attachEffect, html } from "";

class Counter extends WebComponent {
  static props = {
    count: 0,
    sum: 0

  get template() {
    return html`
      <button onClick=${() => ++this.props.count}>
      <button onClick=${() => this.reset()}>reset</button>

  onInit() {
    attachEffect(this.props.count, (count) => {
        `(${this.props.sum} * ${count}) from inside`,
        this.props.sum * count

  getSum(x) {
    this.props.sum += x;

  reset() {
    this.props.sum = 0;
    this.props.count = 0;

customElements.define("my-counter", Counter);

// somewhere else, attach effect from outside component
const counter = document.querySelector("my-counter");
attachEffect(counter.props.sum, (sum) =>
  console.log("hello from the other side", sum)