Swelıty
Tools for everyone

Free Online Bootstrap Playground

Try Bootstrap 5 layouts and components live. Write HTML with Bootstrap classes, add your own CSS and script, and see the result with a console beside the preview.

Press Run, or Ctrl or Cmd + Enter, to run your code. The page shows in Preview and everything you log shows in Console. Use Stop if a script never ends. Bootstrap 5, with its styles and scripts, is loaded for you. Your CSS comes after Bootstrap's.

Preview

Console

Output appears here. Press Run, then try console.log("Hello")

How to use

  1. Write HTML with Bootstrap classes in the HTML tab, such as container, row, col, btn and card.

  2. Use data attributes like data-bs-toggle for modals, dropdowns and collapses, or control them from the JavaScript tab through the global bootstrap object.

  3. Add your own styles in the CSS tab. They load after Bootstrap's, so they can override it.

  4. Press Run, or Ctrl or Cmd + Enter. Turn on Auto-run to refresh the preview as you type.

  5. Check console output, warnings and errors in the Console panel under the preview.

  6. Use Format to tidy the tab you are editing, or open the full screen editor for more room.

Why use this tool

  • Bootstrap 5.3

    The current Bootstrap 5 stylesheet and script bundle, loaded for you.

  • Working components

    Modals, toasts, dropdowns, tooltips and collapses run from data attributes or from your own script.

  • Separate HTML, CSS and JavaScript

    Keep markup, styles and behaviour apart.

  • Isolated preview

    Your code runs in an isolated frame, so it cannot reach this site or your other tabs.

  • Comfortable editor

    Resize the text, switch line wrapping on or off, or go full screen with the editor and preview side by side.

About this tool

Prototype with Bootstrap 5 in your browser. Write HTML with Bootstrap's grid, utility and component classes, add your own CSS, and use the JavaScript tab to drive modals, toasts, tooltips and dropdowns. Bootstrap's stylesheet and script bundle, Popper included, are loaded for you, so a layout takes seconds to try instead of a project to set up. It suits learning the grid, testing a component, or sketching a page before you build it for real.

Frequently asked questions

Bootstrap 5.3, loaded from a public CDN and verified with an integrity check.

No. Bootstrap 5 does not need it. To work with jQuery, open the jQuery Playground.

Not through Sass, because the ready-made stylesheet is used. Override colours and spacing in the CSS tab, or set Bootstrap's CSS variables.

Yes, the first time you press Run, because Bootstrap is fetched from a public CDN.

Yes. Untick Wrap long lines under the editor and it scrolls sideways instead. Your choice is remembered on this device.