M Majid DS mds
GitHub

Layouts

Sidebar

A navigation column, collapsible on desktop and off-canvas on mobile.

A sidebar placed before the header owns the full page height. In RTL it sits on the right automatically.

<flux:sidebar sticky class="border-e border-zinc-200 bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-900">
    <flux:sidebar.header>
        <flux:sidebar.brand href="/" name="Majid DS" />
    </flux:sidebar.header>

    <flux:sidebar.search placeholder="Search products..." kbd="⌘K" />

    <flux:sidebar.nav>
        <flux:sidebar.item href="#" icon="home" current>Dashboard</flux:sidebar.item>
        <flux:sidebar.item href="#" icon="shopping-bag" badge="3">My orders</flux:sidebar.item>
        <flux:sidebar.item href="#" icon="heart">Favorites</flux:sidebar.item>

        <flux:sidebar.group heading="Categories" icon="squares-2x2" expandable :expanded="true">
            <flux:sidebar.item href="#">Phones &amp; tablets</flux:sidebar.item>
            <flux:sidebar.item href="#">Home appliances</flux:sidebar.item>
        </flux:sidebar.group>
    </flux:sidebar.nav>

    <flux:sidebar.spacer />

    <flux:sidebar.nav>
        <flux:sidebar.item href="#" icon="cog-6-tooth">Settings</flux:sidebar.item>
    </flux:sidebar.nav>

    <flux:sidebar.profile avatar="/me.jpg" name="Sara Rezaei" />
</flux:sidebar>
This preview is a still of the sidebar's contents. For the real thing — collapsing to an icon rail, sliding in over a backdrop on mobile — open the layout gallery.

Collapsible

collapsible collapses the sidebar to an icon rail on desktop; collapsible="mobile" keeps it in the grid on desktop and turns it into an off-canvas panel below lg. Items fall back to their tooltips once the labels are hidden.

Majid DS
Collapse sidebar
<flux:sidebar sticky collapsible>
    <flux:sidebar.header>
        <flux:sidebar.brand href="/" name="Majid DS" />
        <flux:sidebar.collapse tooltip="Collapse sidebar" />
    </flux:sidebar.header>

    <flux:sidebar.nav>
        <flux:sidebar.item href="#" icon="home" tooltip="Dashboard" current>Dashboard</flux:sidebar.item>
    </flux:sidebar.nav>
</flux:sidebar>

{{-- In the header, for mobile --}}
<flux:sidebar.toggle class="lg:hidden" icon="bars-2" aria-label="Open menu" />

Reference

flux:sidebar

PropDescription
stickyPins the sidebar and caps its height to the viewport.
collapsibletrue for an icon rail on desktop, or "mobile" for off-canvas below lg.

flux:sidebar.header

Top block, usually the brand and the collapse button.

flux:sidebar.brand

Brand that collapses to the logo mark. Same props as flux:brand.

flux:sidebar.collapse

PropDescription
tooltipTooltip on the collapse button.

flux:sidebar.toggle

Opens the off-canvas sidebar. Put it in the header.

flux:sidebar.nav

Wraps a run of sidebar items.

flux:sidebar.item

PropDescription
hrefLink target.
currentMarks the active page.
iconLeading icon name.
badgeBadge content on the trailing edge.
badge-colorBadge color.
tooltipTooltip shown while the sidebar is collapsed.
tooltip:positionTooltip side. Default: right.

flux:sidebar.group

PropDescription
headingGroup label.
iconLeading icon name.
expandableMakes the group collapsible.
expandedInitial state.

flux:sidebar.spacer

Pushes everything after it to the bottom.

flux:sidebar.profile

The user block at the bottom. Same props as flux:profile.

Related