Layouts
Toggle sidebar

Sidebar

Use a sidebar navigation layout to keep your application content front and center.

Inset main

Add inset to Main to place your content in a bordered panel with rounded corners.

Set the background around the panel on your layout and sidebar. Add lg:ms-0 to the main to remove the extra margin beside the sidebar.

Secondary header

Use a top header for secondary navigation.

Collapsible sidebar

Make your app feel more spacious with a collapsible sidebar.

Persisting the collapsed state

A collapsible sidebar remembers whether it's collapsed in a cookie and restores it before the page paints, with no server code. To store it yourself, such as in the user's settings, pass persist={false} and control it:

Copy to clipboard
const [collapsed, setCollapsed] = useState(user.sidebarCollapsed);<Sidebar collapsible persist={false} collapsed={collapsed} onCollapsedChange={setCollapsed}>    ...</Sidebar>

JavaScript methods

You can import the sidebar() function from @fluxui-dev/react to toggle, open, and close the sidebar from anywhere, such as a keyboard shortcut. On desktop, open and close expand and collapse a collapsible sidebar; on mobile, they open and close the off-canvas sidebar.

Copy to clipboard
import { sidebar } from '@fluxui-dev/react';sidebar().toggle();sidebar().open();sidebar().close();// Toggle the sidebar with ⌘B or Ctrl+B...useEffect(() => {    const onKeyDown = (event: KeyboardEvent) => {        if (event.key === 'b' && (event.metaKey || event.ctrlKey)) {            event.preventDefault();            sidebar().toggle();        }    };    document.addEventListener('keydown', onKeyDown);    return () => document.removeEventListener('keydown', onKeyDown);}, []);

Reference

Prop
Description
sticky
When present, makes the sidebar sticky when scrolling.
collapsible
Controls sidebar collapse behavior. Values: "mobile" (mobile-only), true (both mobile and desktop), false (never collapsible).
breakpoint
The viewport breakpoint for mobile/desktop behavior. Accepts pixel values (1024, "1024px") or rem values ("64rem"). Defaults to 1024.
persist
Controls whether the collapsed state is saved to a flux_sidebar_collapsed cookie, restored before the page paints with no server setup. Defaults to true (desktop collapsed state persists across sessions). Set to false to disable persistence.
collapsed
Controlled collapsed state on desktop. Pair with onCollapsedChange.
defaultCollapsed
Initial collapsed state on desktop when uncontrolled. Default: false.
onCollapsedChange
Callback fired when the desktop collapsed state changes, including when a saved state is restored, receiving the new state and eventDetails, whose reason is trigger-press, imperative-action for a call to sidebar(), or initial for a restored state.
Attribute
Description
data-flux-sidebar
Applied to the root element for styling and identification.
data-flux-sidebar-on-desktop
Applied when the viewport is at or above the breakpoint.
data-flux-sidebar-on-mobile
Applied when the viewport is below the breakpoint.
data-flux-sidebar-collapsed-desktop
Applied while the sidebar is collapsed to icons on desktop.
data-flux-sidebar-collapsed-mobile
Applied while the off-canvas sidebar is closed on mobile.

Sidebar.Header

Content for the sidebar header, typically containing brand and collapse button.

Sidebar.Brand

Prop
Description
href
The URL to navigate to when the brand is clicked. Default: /. An in-app URL navigates through the link registered in FluxProvider.
logo
The URL or path to the logo image, or an element such as an SVG or icon.
logoDark
The URL or path to the logo image for dark mode, used when logo is a URL.
logoClassName
CSS classes applied to the box around a logo element, such as its size, shape, and background.
name
The brand name to display next to the logo, hidden while the sidebar is collapsed.
alt
Alternative text for the logo.
iconTrailing
Icon to display after the name, such as a chevron when the brand opens a dropdown: a component or an element.
iconVariant
Variant of the trailing icon: outline, solid, mini, or micro. Default: micro.
render
Element to render instead of the a tag (such as <button type="button" /> for a brand that opens a dropdown, which adds a hover background), with the brand's props merged in. Also accepts a function that receives the props and returns an element.

Sidebar.Collapse

Prop
Description
inset
Positioning of the collapse button. Space-separated values like "left", "right", "top", "bottom", or combinations like "left top bottom", or true for all sides.
tooltip
Tooltip text shown on hover, also used as the button's accessible name. Defaults to "Toggle sidebar"; an empty string disables it. Pass a Tooltip element without children, such as <Tooltip kbd="⌘B" />, to set its options; it shows on the right by default.

Sidebar.Search

Button styled as a search field for opening your own search, such as a command palette.

Prop
Description
placeholder
Text displayed in the button. Default: "Search...".
kbd
Keyboard shortcut hint displayed at the end of the button, such as "⌘K".
tooltip
Tooltip text shown when the sidebar is collapsed. Defaults to placeholder, with kbd at its end. Pass a Tooltip element without children to set its options; it shows on the right by default.
render
Element to render instead of the button, with the search button's props merged in. Also accepts a function that receives the props and returns an element.

Sidebar.Nav

Navigation items and groups to display.

Sidebar.Item

Prop
Description
href
The URL to navigate to when the item is clicked. When set, the item renders as an a tag. An in-app URL navigates through the link registered in FluxProvider.
render
Element to render instead of the item (such as a router link with props href can't carry), with the item's props merged in. Also accepts a function that receives the props and returns an element.
icon
The icon to display before the item text, a component or an element such as <img />, and the only part shown while the sidebar is collapsed.
iconTrailing
Icon to display at the end of the item: a component or an element.
iconVariant
Variant of the item's icons: outline, solid, mini, or micro. Default: outline.
iconDot
If true, displays a small dot on the icon, such as for unread notifications.
badge
A badge value to display on the right side of the item: text or a number renders in a zinc badge, an element such as Navlist.Badge renders as is, and nothing renders for undefined, null, false, or an empty string.
current
When present, indicates this is the currently active item and sets aria-current="page". Without it, the item is current when its href matches FluxProvider's currentUrl.
accent
If false, the current item uses zinc instead of the accent color. Default: true.
tooltip
Tooltip text shown when sidebar is collapsed. Defaults to the item's text content. Pass a Tooltip element without children, such as <Tooltip kbd="G I" />, to set its options; it shows on the right by default.
Attribute
Description
data-flux-sidebar-item
Applied to the root element for styling and identification.
data-current
Applied when the item is active/current.

Sidebar.Group

Prop
Description
heading
The heading text for the group.
expandable
When present, allows the group to be expanded/collapsed.
icon
The icon to display before the group heading instead of the default chevron icon, a component or an element. Groups without an icon specified will be hidden when the sidebar is collapsed, and groups with one open their items in a menu.
iconVariant
Variant of the icon: outline, solid, mini, or micro. Default: outline.
defaultOpen
Controls the initial expanded state when uncontrolled. Defaults to true.
open
Controlled expanded state of an expandable group. Pair with onOpenChange.
onOpenChange
Callback fired when an expandable group expands or collapses, receiving the new open state and eventDetails, whose reason tells why.

Sidebar.Spacer

Fills the free space in the sidebar, pushing what follows to the bottom.

Sidebar.Profile

Prop
Description
avatar
The URL or path to the user's avatar image, or a custom Avatar element.
name
The user's display name, hidden while the sidebar is collapsed.
initials
Custom initials to display when no avatar image is provided. Automatically generated from name if not provided.
circle
Whether to display a circular avatar. Default: false.
chevron
Whether to display a chevron icon (dropdown indicator). Default: true.
iconTrailing
Icon to display instead of the chevron: a component, such as ChevronUpDownIcon from @fluxui-dev/react/icons, or an element.
iconVariant
Variant of the trailing icon: outline, solid, mini, or micro. Default: micro.
render
Element to render instead of the profile button, with its props merged in.

Sidebar.Toggle

Button that opens and closes the sidebar from anywhere on the page, such as a header menu button, accepting all Button props except href.

Prop
Description
icon
The icon to display in the toggle button (e.g., Bars2Icon, XMarkIcon).
inset
Positioning of the toggle button (e.g., left).

Controls every sidebar on the page from anywhere, and does nothing if no sidebar is mounted. A controlled sidebar receives the change through onCollapsedChange.

Method
Description
toggle()
Does what Sidebar.Toggle does: collapses or expands the sidebar on desktop, and opens or closes it on mobile.
open()
Expands the sidebar on desktop, or opens it on mobile and moves focus onto it.
close()
Collapses the sidebar on desktop, or closes it on mobile.

Main

Prop
Description
inset
Displays the main content in a bordered surface with rounded corners and outer gutters on large screens. The layout fills the viewport and the main scrolls internally. On smaller screens, the main is full width and uses normal page scrolling.
container
When present, constrains the main content to a container width. With inset, the content is centered inside the full-width surface.
Attribute
Description
data-flux-main
Applied to the root element for styling and identification.
Copyright © 2026 Wireable LLC ·Terms of Service
Built with by
Caleb Porzio and Hugo Sainte-Marie