SidepanelA collapsible side navigation panel component.
The Sidepanel component provides a collapsible navigation panel with header, main content, and footer sections.
The Sidepanel supports expanded and collapsed states with smooth transitions.
The Sidepanel implements the following accessibility features:
Install the component from your command line.
npm install @raystack/apsara
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 objecticon
: ReactNodelabel
: stringhref
: string (optional)onIconClick
: Optional callback for icon click
logo
: ReactNode for the header icon/logotitle
: string for the header textonLogoClick
: Optional callback for logo click
icon
: ReactNode for the item's iconhref
: string for the link destinationactive
: boolean to indicate current selectionchildren
: ReactNode for the item's label
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)
loading...
loading...
-
Proper ARIA roles and attributes
role="navigation"
for the main sidebarrole="banner"
for the headerrole="menuitem"
for navigation itemsaria-expanded
to indicate sidebar statearia-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