Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <head>
  <meta charset="utf-8" />
  <title>React from CDN</title>
  <style>/* moved to CSS panel */</style>
</head>

<body>
  <!-- Target container -->
  <div id="app"></div>

  <!-- React --><!-- ReactDOM -->
  <script src="https://unpkg.com/react@17/umd/react.development.js"></script>
  <script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js">
  </script>

<!-- Our own custom React code is now in the JS panel -->
              
            
!

CSS

              
                .purple {
  color: purple;
}
.eighty {
  font-size: 80px;
}
.seventy {
  font-size: 70px;
}
.fifty {
  font-size: 50px;
}

              
            
!

JS

              
                function MainMenu() {
  return (
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
      <div class="container-fluid">
        <a class="navbar-brand" href="#">
          Navbar
        </a>
        <button
          class="navbar-toggler"
          type="button"
          data-bs-toggle="collapse"
          data-bs-target="#navbarNav"
          aria-controls="navbarNav"
          aria-expanded="false"
          aria-label="Toggle navigation"
        >
          <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
          <ul class="navbar-nav">
            <li class="nav-item">
              <a class="nav-link active" aria-current="page" href="#">
                Home
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">
                Features
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">
                Pricing
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link disabled">Disabled</a>
            </li>
          </ul>
        </div>
      </div>
    </nav>
  );
}

function Jumbotron() {
  return (
    <div class="p-5 mb-4 bg-light rounded-3 text-center">
      <div class="container-fluid py-5 text-center">
        <h1 class="display-5 fw-bold">Custom jumbotron</h1>
        <p class="col-md-8 fs-4 m-auto mt-5 mb-5">
          Using a series of utilities, you can create this jumbotron, just like
          the one in previous versions of Bootstrap. Check out the examples
          below for how you can remix and restyle it to your liking.
        </p>
        <button class="btn btn-primary btn-lg" type="button">
          Example button
        </button>
      </div>
    </div>
  );
}

function Footer() {
  return (
    <div class="container">
      <footer class="py-3 my-4">
        <ul class="nav justify-content-center border-bottom pb-3 mb-3">
          <li class="nav-item"><a href="#" class="nav-link px-2 text-muted">
            Home</a></li>
          <li class="nav-item"><a href="#" class="nav-link px-2 text-muted">
            Features</a></li>
          <li class="nav-item"><a href="#" class="nav-link px-2 text-muted">
            Pricing</a></li>
          <li class="nav-item"><a href="#" class="nav-link px-2 text-muted">
            FAQs</a></li>
          <li class="nav-item"><a href="#" class="nav-link px-2 text-muted">
            About</a></li>
        </ul>
        <p class="text-center text-muted">© 2021 Company, Inc</p>
      </footer>
    </div>    
  );
}

const app = (
  <div>
    <MainMenu />
    <Jumbotron />
    <Footer />
  </div>
)

ReactDOM.render(app, document.getElementById("app"));

              
            
!
999px

Console