Skip to component content

Compose a Sidebar surface from Bootstrap-native header, content, footer, menu, disclosure, action, badge, and loading-row primitives.

Usage

Use the app layout when a route owns an application shell. Its navigation-enabled form emits one public .sidebar region beside one independent page region. The Sidebar component owns only the inner navigation surface and its anatomy; App owns the outer shell, side placement, visual variant, and collapse mode. The Page layout owns semantic header, main, and footer regions.

Call sidebar() for the inner surface. Do not pass App shell options such as side, variant, collapsible, or id to that component; those belong to app().

Compose the sidebar from public component contracts: Button for triggers, Dropdown Menu for row actions, Collapse for nested groups, Tooltip for collapsed labels, Badge for counters, Separator for section rhythm, and Skeleton for loading rows. Keep navigation links semantic and do not hide required routes behind hover-only behavior.

Bootstrap owns Offcanvas, Collapse, Dropdown, and Tooltip behavior. The optional Moo UI Sidebar ESM should coordinate only the responsive shell state Bootstrap does not provide, such as collapsed desktop width, mobile offcanvas state, and persisted user preference.

Application shell

Compose the shell from documented sidebar regions. The preview uses the same floating sidebar block frame so the application shell is exercised as a standalone viewport.

<div class="card h-100">
  <div class="card-header">
    <div class="card-header__text">
      <h3 class="card-title">Application shell preview</h3>
    </div>
  </div>
  <div class="card-body">The complete Sidebar and Page composition is shown in the standalone preview.</div>
</div>

Composition

Sidebar parts compose public component contracts. Actions use Button and Dropdown Menu markup, metadata uses Badge, form fields use Input, separators use Separator, and loading rows use Skeleton.

Diagram labeling the public Sidebar classes for the wrapper, header, content, footer, and inset regions.

These are the public HTML hooks that applications can inspect or target. They describe rendered markup, not the repository's internal Jinja build helpers.

Selector Purpose

Bootstrap owns Dropdown, Collapse, Offcanvas, and Tooltip. Moo UI's optional Sidebar module coordinates the shell state Bootstrap does not provide: desktop collapse and persistence, the rail and keyboard shortcut, collapsed flyouts, RTL placement, and responsive tooltip ownership.

Importing the module never scans the document. Initialize only a [data-slot="sidebar-wrapper"] root emitted by app; repeated initialization returns the same instance, and dispose() releases listeners, generated flyouts, positioning, tooltips, and the mobile Offcanvas instance owned by Sidebar.

Some design references call this state helper useSidebar. In Moo UI it is not a React hook. It is the rendered data-sidebar-state attribute plus the public Sidebar instance that updates it.

Status
Accepted
Runtime
optional Moo UI ESM
Markup
Moo UI documented extension
Reference

The mobile drawer and collapse behavior build on Bootstrap's own Offcanvas and Collapse plugins; see the Bootstrap Offcanvas documentation.

For the nested collapse behavior, see the Bootstrap Collapse documentation.

Settings

Theme
Choose how Moo UI looks on this device.
Sidebar
Choose how the sidebar sits on the page.
Theme Builder
Tune catalog tokens and chart colors for this browser.
Base color
Theme color
Chart color
Heading font
Body font
Radius
Direction
Choose the reading direction. RTL flips the layout live.
Reset

Restore the default appearance.