Bootstrap 5 Features

Core improvements in Bootstrap 5 that speed up modern UI development.

What changed in Bootstrap 5?

  • No jQuery dependency: Components use vanilla JavaScript APIs.
  • More utilities: Spacing, display, flex, opacity, and responsive helpers expanded.
  • Offcanvas and improved forms: Better mobile navigation and cleaner input styles.
  • CSS variables: Easier theme control and runtime style changes.

Feature Comparison Snapshot

FeatureBootstrap 4Bootstrap 5
JavaScript dependencyRequires jQueryNo jQuery required
Layout supportFlex utilitiesExpanded flex + utility APIs
New componentsLimited mobile panel patternsBuilt-in Offcanvas
ThemingSass-heavy customizationSass + CSS variables

Example: Offcanvas Trigger

<button class="btn btn-primary" data-bs-toggle="offcanvas" data-bs-target="#menuPanel">
  Open Menu
</button>

<div class="offcanvas offcanvas-start" id="menuPanel">
  <div class="offcanvas-header">
    <h5 class="offcanvas-title">Quick Menu</h5>
    <button class="btn-close" data-bs-dismiss="offcanvas"></button>
  </div>
  <div class="offcanvas-body">Content here...</div>
</div>