Weftv0.4.0
GitHubFigma
Blade AI
Display & Navigation · Side Navstable

Side Nav

A dark application sidebar with a header, grouped items, nested links and a footer, in a 256px full width or a 48px icon rail.

Preview

#preview

Switch layout, header, footer and the forced item state. Show code opens the React and CSS below.

expanded · reports default
side-nav-example.tsx
import { SideNav } from "@blade-ai/weft/components/side-nav";

export function AppSidebar() {
  return (
    <SideNav
      header={{ mark: <Logo />, title: "Blade AI", subtitle: "Workspace" }}
      footer={{ mark: <Avatar />, title: "Asha Rao", subtitle: "[email protected]" }}
      sections={[
        {
          heading: "Platform",
          items: [
            { label: "Overview", icon: WorkspaceIcon, isActive: true, href: "/" },
            { label: "Reports", icon: SquareIcon, children: [{ label: "Payouts", href: "/payouts" }] },
          ],
        },
      ]}
    />
  );
}

All states

#all-states

Item states, sub items and both layouts. The rail stays dark in light and dark themes.

Side Nav · 10 variants · 256 wide unless noted
Item · default
Item · active
Item · hover
Item · focus
Item · muted
Item · expandable
Sub item · default
Sub item · active
Expanded · 256
Collapsed · 48

Props

#props

Sections hold items; an item with children becomes a disclosure.

SideNav
Prop
Type
Default
Description
sections *
SideNavSection[]
—
Groups of items, each with an optional heading.
header
SideNavHeader
—
Brand or workspace mark (32px node), title and optional subtitle.
footer
SideNavFooter
—
Avatar node (32px), title and optional subtitle.
isCollapsed
boolean
false
48px icon rail instead of the 256px full nav.
accessibilityLabel
string
"Sidebar"
Accessible name of the nav landmark.
className
string
—
Extra classes on the aside.
SideNavItemData
Prop
Type
Default
Description
label *
string
—
Item text; also the tooltip and name in collapsed mode.
icon
IconComponent
—
16px leading icon. Required for collapsed mode, where only the icon shows.
href
string
—
Renders the row as a link.
isActive
boolean
false
Current page: light fill, bold label, aria-current="page".
onClick
() => void
—
Click handler for a button row.
children
SideNavSubItem[]
—
Nested links. The row becomes a disclosure button that expands them under a left rail.
isDefaultExpanded
boolean
false
Starts expanded when it has children.
isMuted
boolean
false
Dims the row to 70% (the "More" overflow entry).
data-state
"hover" | "focus"
—
Docs and testing hook: render the item in a visual state without interaction.
SideNavSubItem, SideNavSection, SideNavHeader and SideNavFooter
Prop
Type
Default
Description
sub.label *
string
—
Sub item text.
sub.href / sub.onClick
string / () => void
—
Link target or click handler.
sub.isActive
boolean
false
Current sub page: light fill, aria-current="page".
section.heading
string
—
Small group heading, hidden when collapsed.
section.items *
SideNavItemData[]
—
Items in the group.
header.mark / footer.mark *
ReactNode
—
32px square node.
header.title / footer.title *
string
—
Primary line.
header.subtitle / footer.subtitle
string
—
Secondary line.

Usage

#usage

Short rules for using side nav.

Do
Group items under short headings such as Platform.
Give every item an icon so the rail still works collapsed.
Mark the current page with isActive.
Keep nesting to one level.
Don't
Don't nest sub items more than one level deep.
Don't use it on narrow screens; use Bottom Nav.
Don't put actions in it; it is for navigation.
Don't use long labels; they truncate.

Accessibility

#accessibility

A nav landmark of links and buttons. The current page carries aria-current.

Keyboard
Key
Action
Tab / Shift+Tab
Moves through items and sub items in order.
Enter
Follows a link or activates a button row.
Enter / Space
On a row with children, expands or collapses its sub items.
ARIA
Element
Role / attribute
When
Container
<aside>, <nav aria-label>
Always; label from accessibilityLabel.
Current item
aria-current="page"
On the active item or sub item.
Disclosure row
aria-expanded, aria-controls
On rows that have children.
Collapsed item
aria-label, title
Collapsed mode, where the label is hidden.
Icons and chevron
aria-hidden="true"
Always; decorative.