Skip to main content

Getting started

No JavaScript

How every Bootstrap plugin is replaced by native HTML and progressively enhanced CSS.

The rule

Every interactive component has a baseline that works with nothing but HTML and widely-supported CSS, and one or more enhancements that newer engines pick up through @supports. Nothing requires a script, and nothing breaks when an enhancement is missing — it just looks a little plainer.

Four native mechanisms do almost all of the work:

  • <details> / <summary> — toggling (collapse, accordion, dropdown).
  • The Popover API — top-layer overlays with light-dismiss and Escape (modal, offcanvas, popover, toast, dropdown).
  • <dialog> + <form method="dialog"> — dismissal (alerts, modal close buttons).
  • :has(), radios and :target — state without a class toggle (tabs, navbar collapse, fallbacks).

Component matrix

Bootstrap plugin Baseline mechanism Enhancement Page
Collapse<details class="collapse">Animated height via ::details-content + interpolate-sizeCollapse
Accordion<details name="…"> (exclusive groups are native)Same height animationAccordion
Dropdown<details class="dropdown">popover menu + anchor positioning (light-dismiss)Dropdowns
Navbar collapseCheckbox + :has()—Navbar
Tabs / pillsRadio inputs, panes paired by index—Navs & tabs
Modal<dialog popover> + popovertarget; :target fallbackcommand="show-modal" for true modality; @starting-style fadeModal
Offcanvaspopover + popovertarget; :target fallbackSlide transition via @starting-styleOffcanvas
Alert dismiss<dialog open> + <form method="dialog">—Alerts
Toastpopover="manual" + popovertargetaction="show"Fade in, CSS auto-hideToasts
Tooltipdata-bs-title rendered by attr() on hover/focusAnchor positioning escapes overflow clippingTooltips
Popoverpopover element, invoker is the implicit anchorAnchor positioning with flip fallbacks; centered otherwisePopovers
CarouselScroll-snap track + anchor-link indicators::scroll-button() / ::scroll-marker; view-timeline fadeCarousel
ScrollspyPlain anchor navScroll-driven animation with timeline-scopeScrollspy
Button toggle.btn-check (already CSS in Bootstrap)—Buttons
Form validation:user-invalid / :user-valid—Validation

The Popover API in one minute

Any element with a popover attribute is hidden until shown, then rendered in the browser's top layer above everything else. A <button popovertarget="id"> toggles it; popovertargetaction="show" or "hide" makes the button one-way.

  • popover (auto) — clicking outside or pressing Escape closes it. Modals, offcanvas, dropdowns, popovers.
  • popover="manual" — stays until a button hides it. Toasts.
  • ::backdrop styles the dimmer behind it.
  • autofocus on an element inside moves keyboard focus when it opens.
Top layer
Click outside or press Escape to close.
HTML
<button class="btn btn-primary" popovertarget="pop-demo">Toggle</button>
<div class="popover" popover id="pop-demo" data-bs-placement="bottom">
  <div class="popover-arrow"></div>
  <div class="popover-header">Top layer</div>
  <div class="popover-body">Click outside or press Escape to close.</div>
</div>

Enhancement features used

FeatureUsed byWithout it
CSS anchor positioning (position-area)Dropdown popovers, popovers, tooltipsDropdown becomes a bottom sheet; popover centers in the viewport; tooltips stay absolutely positioned
@starting-style + transition-behavior: allow-discreteModal, offcanvas, toast, popover fadesInstant show/hide
::details-content + interpolate-sizeCollapse, accordionInstant open/close
::scroll-button(), ::scroll-markerCarouselHand-written indicator links; swipe or scroll
Scroll-driven animations (view(), timeline-scope)Carousel fade, scrollspyNo crossfade; nav link is not highlighted
Invoker commands (command="show-modal")ModalPopover modal (no inert background)

What you lose without a script

Be honest about the trade. These are the behaviours that have no CSS equivalent:

  • A toast that appears on its own after an event. Toasts open from a button.
  • A carousel that auto-advances. Ours waits for the user.
  • Closing a <details> dropdown by clicking elsewhere. Use the popover variant for light-dismiss.
  • Scrollspy in engines without scroll-driven animations.
  • Opening a modal, offcanvas or toast from anything other than a button or link.

Everything else — keyboard access, focus rings, Escape to close, reduced-motion — is handled natively.

Legacy Bootstrap markup

Static classes still work: .collapse.show, .tab-pane.active, .toast.show, .navbar-collapse.show, .dropdown-menu.show all render as before. data-bs-toggle attributes are inert except data-bs-toggle="tooltip", which the CSS reads. .fade no longer hides an element; it only opts into the fade transition.