Skip to content

Sidebar

Sidebar provides application-shell navigation that collapses to an icon rail on desktop and a drawer on narrow viewports. Use a page-local menu or native nav when the navigation does not belong to the application shell.

Code
import {
AppHeader,
AppHeaderContent,
AppHeaderLeading,
AppLayout,
AppLayoutContent,
AppLayoutMain,
LayoutDashboardIcon,
PackageIcon,
PageContent,
PageHeader,
PageHeaderTitle,
Sidebar,
SidebarBrand,
SidebarContent,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
SidebarProvider,
SidebarTrigger,
SproutIcon,
} from "@falcon/ui-kit";
export function Example() {
return (
<SidebarProvider>
<AppLayout>
<Sidebar>
<SidebarBrand logo={<SproutIcon />} name="Farm operations" />
<SidebarContent aria-label="Primary navigation">
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton
icon={<LayoutDashboardIcon size={16} />}
render={<a href="/components/app-layout" />}
tooltip="Dashboard"
>
Dashboard
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem>
<SidebarMenuButton
icon={<PackageIcon size={16} />}
isActive
render={<a aria-current="page" href="/components/sidebar" />}
tooltip="Orders"
>
Orders
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
</SidebarContent>
</Sidebar>
<AppLayoutContent>
<AppHeader>
<AppHeaderLeading>
<SidebarTrigger />
</AppHeaderLeading>
<AppHeaderContent>Orders</AppHeaderContent>
</AppHeader>
<AppLayoutMain>
<PageHeader>
<PageHeaderTitle>Open orders</PageHeaderTitle>
</PageHeader>
<PageContent>
<p className="tw:text-sm tw:text-muted-foreground">
Open orders for every location go here.
</p>
</PageContent>
</AppLayoutMain>
</AppLayoutContent>
</AppLayout>
</SidebarProvider>
);
}
SidebarProvider
└── AppLayout
├── Sidebar
│ ├── SidebarBrand or SidebarHeader
│ ├── SidebarContent
│ │ ├── SidebarActionButton
│ │ ├── SidebarMenu
│ │ │ └── SidebarMenuItem
│ │ │ ├── SidebarMenuButton
│ │ │ ├── SidebarMenuAction
│ │ │ ├── SidebarMenuBadge
│ │ │ └── SidebarMenuSub
│ │ │ └── SidebarMenuSubItem
│ │ │ ├── SidebarMenuSubIndicator
│ │ │ └── SidebarMenuSubButton
│ │ └── SidebarGroup
│ │ ├── SidebarGroupLabel
│ │ ├── SidebarGroupAction
│ │ └── SidebarGroupContent
│ │ └── SidebarMenu
│ └── SidebarFooter
│ ├── SidebarSeparator
│ └── SidebarUser
└── AppLayoutContent
└── AppHeader
└── SidebarTrigger

Wrap the complete AppLayout, including every SidebarTrigger, in SidebarProvider. See Layout for the complete shell, grouped and nested navigation, and collapsed navigation compositions.

Use a SidebarMenuButton flyout when a parent navigation item must expose its destinations from the collapsed desktop icon rail. This configuration-object API exists because the expanded nested menu is not rendered in that state; it is a Sidebar-specific exception, not a general alternative to Falcon’s JSX compound components.

Provides application-shell navigation as a desktop panel or mobile drawer. Renders a <div> element on desktop and accepts standard <div> props.

Renders a primary Sidebar action as a <button> element, with optional tooltip content for its collapsed state.

children?: React.ReactNode

Action label.

className?: string

CSS class applied to the action button.

icon: React.ReactNode

Icon shown in the action button.

onClick?: React.MouseEventHandler<HTMLButtonElement>

Event handler called when the action button is clicked.

tooltip?: string

Supplemental tooltip text for the collapsed desktop state.

Renders a Sidebar header containing a brand logo and optional name.

logo: React.ReactNode

Brand mark shown in the Sidebar header.

name?: React.ReactNode

Company or application name.

Contains the Sidebar’s primary navigation. Renders a <nav> element and accepts standard <nav> props.

Contains account or secondary controls at the bottom of a Sidebar. Renders a <div> element and accepts standard <div> props.

Groups related Sidebar navigation items. Renders a <div> element and accepts standard <div> props.

Renders an action in a SidebarGroup label row as a <button> element and accepts standard <button> props.

Contains SidebarGroup navigation items. Renders a <div> element and accepts standard <div> props.

Labels a SidebarGroup. Renders a <div> element and accepts standard <div> props.

Contains branding or controls at the top of a Sidebar. Renders a <div> element and accepts standard <div> props.

Contains Sidebar menu items. Renders a <ul> element and accepts standard <ul> props.

Renders an action on a SidebarMenuItem as a <button> element and accepts standard <button> props.

showOnHover?: boolean

Whether the action is visible only while its menu item is hovered.

Renders a count or status badge on a SidebarMenuItem. Renders a <div> element and accepts standard <div> props.

Renders a Sidebar navigation item as a <button> element by default, optionally with a collapsed-desktop flyout. Use render for navigation links.

children?: React.ReactNode

Menu item label.

className?: string

CSS class applied to the menu button.

expanded?: boolean

When provided, renders a chevron indicator on the right. Manage state externally via onClick. In the mobile drawer sections are always expanded, so the button stops toggling and hides the chevron.

flyout?: SidebarMenuButtonFlyoutItem[]

Sidebar-specific collapsed-desktop flyout configuration objects. Clicking the button toggles the flyout; it is ignored in expanded mode.

icon?: React.ReactNode

Icon shown before the menu button label.

isActive?: boolean

Whether the menu button represents the current location. When rendering a link, also set aria-current on the element passed to render.

onClick?: React.MouseEventHandler<HTMLButtonElement>

Event handler called when the menu button is clicked, except when a collapsed flyout handles the click or a mobile parent section is expanded.

render?: React.ReactElement<any, string | React.JSXElementConstructor<any>>

Render the button as this element (e.g. an <a> for navigation) instead of a native button; the label stays in children.

tooltip?: string

Supplemental text shown in the collapsed-desktop tooltip. This does not set the rendered element’s accessible name.

Wraps a Sidebar menu item and its related controls. Renders an <li> element and accepts standard <li> props.

Contains a nested Sidebar menu. Renders a <div> element and accepts standard <div> props when visible.

expanded?: boolean

Desktop visibility, driven by the parent button’s expanded state. The mobile drawer ignores it and always shows the sub-menu.

Renders a nested Sidebar navigation item as a <button> element by default. Use render for navigation links.

children?: React.ReactNode

Nested menu item label.

className?: string

CSS class applied to the nested menu button.

isActive?: boolean

Whether the nested menu button represents the current location. When rendering a link, also set aria-current on the element passed to render.

onClick?: React.MouseEventHandler<HTMLButtonElement>

Event handler called when the nested menu button is clicked.

render?: React.ReactElement<any, string | React.JSXElementConstructor<any>>

Render the button as this element (e.g. an <a> for navigation) instead of a native button; the label stays in children.

Renders the connector for a nested Sidebar menu item as a <div> element. It accepts no props.

Wraps a nested Sidebar menu item. Renders a <div> element and accepts standard <div> props.

Provides shared responsive state for a Sidebar and its triggers. Renders a <div> element and accepts standard <div> props.

defaultOpen?: boolean = true

Initial desktop expanded state for uncontrolled sidebars. Defaults to true.

onOpenChange?: ((open: boolean) => void)

Controlled desktop state change handler.

open?: boolean

Controlled desktop expanded state.

Separates Sidebar content regions. Renders a <div> element and accepts standard <div> props.

Opens the mobile drawer or collapsed desktop sidebar. Renders a <button> element and accepts className and onClick from standard <button> props.

Renders a Sidebar account control in a <div> element with a button that opens its menu content.

menuContent?: React.ReactNode

Content shown when the account control is opened.

name?: string

Full name used to render the user row and auto-generate 2-letter initials.

Accesses responsive Sidebar state and controls. Throws when used outside a SidebarProvider.