SidepanelA collapsible side navigation panel component. Install the component from your command line.
npm install @raystack/apsara
The Sidepanel component provides a collapsible navigation panel with header, main content, and footer sections.
import { Sidepanel } from '@raystack/apsara/v1'

export default function App() {
  return (
    <Sidepanel.Root open={true}>
      <Sidepanel.Header logo={<InfoCircledIcon />} title="Company Name" />
      <Sidepanel.Main>
        <Sidepanel.Item href="#" icon={<InfoCircledIcon />} active>Dashboard</Sidepanel.Item>
      </Sidepanel.Main>
      <Sidepanel.Footer>
        <Sidepanel.Item href="#" icon={<InfoCircledIcon />}>Help</Sidepanel.Item>
      </Sidepanel.Footer>
    </Sidepanel.Root>
  )
}
  • open: Controls the expanded/collapsed state (boolean)
  • onOpenChange: Callback when expanded/collapsed state changes (function)
  • position: Position of the sidepanel ("left" | "right", default: "left")
  • profile: Optional profile information object
    • icon: ReactNode
    • label: string
    • href: string (optional)
    • onIconClick: Optional callback for icon click
  • logo: ReactNode for the header icon/logo
  • title: string for the header text
  • onLogoClick: Optional callback for logo click
  • icon: ReactNode for the item's icon
  • href: string for the link destination
  • active: boolean to indicate current selection
  • children: ReactNode for the item's label
The Sidepanel component consists of several parts, each with their own props:
  • open: Controls the expanded/collapsed state (boolean)
  • onOpenChange: Callback when expanded/collapsed state changes (function)
  • position: Position of the sidepanel ("left" | "right", default: "left")
  • account: Optional account information object with:
    • icon: Icon element to display (ReactNode)
    • label: Text to display (string)
    • href: Optional URL the account links to (string)
  • logo: Logo element to display (ReactNode)
  • title: Title text to display (string)
  • icon: Icon element to display (ReactNode)
  • active: Whether the item is currently active (boolean)
  • href: URL the item links to (string)
The Sidepanel can be positioned on either the left or right side of the screen.
loading...
The Sidepanel supports expanded and collapsed states with smooth transitions.
loading...
The Sidepanel implements the following accessibility features:
  • Proper ARIA roles and attributes
    • role="navigation" for the main sidebar
    • role="banner" for the header
    • role="menuitem" for navigation items
    • aria-expanded to indicate sidebar state
    • aria-current="page" for active items
  • Keyboard navigation support
    • Enter/Space to toggle sidebar expansion
    • Tab navigation through interactive elements
  • Screen reader support
    • Meaningful labels for all interactive elements
    • Hidden decorative elements
    • Clear state indicators