Skip to content
CraftDocs
GitHub
Home
Home
Changelog
What's New
Guide
Guide
Getting Started
Principles
Styling Components
Theme System
Foundations
All Tokens
Color
Elevation
Icons
Motion
Shape
Spacing
Typography
Libraries
Libraries
@xds/cli
@xds/core
Themes
Themes
Theme: daily
Default Theme
Theme: matcha
Neutral Theme
Components
Components
AppShell
AspectRatio
Avatar
Avatar
AvatarStatusDot
Badge
Banner
Breadcrumbs
BreadcrumbItem
Breadcrumbs
Button
Button
IconButton
ToggleButton
ToggleButtonGroup
Calendar
Card
Carousel
Chat
ChatComposer
ChatComposerDrawer
ChatComposerInput
ChatComposerTokenElement
ChatDictationButton
ChatLayout
ChatLayoutScrollButton
ChatMessage
ChatMessageBubble
ChatMessageList
ChatMessageMetadata
ChatSendButton
ChatSystemMessage
ChatTokenizedText
ChatToolCalls
Checkbox
CheckboxInput
CheckboxList
CheckboxListItem
ClickableCard
Code
CodeBlock
Collapsible
Collapsible
CollapsibleGroup
useXDSCollapsible
CommandPalette
CommandPalette
CommandPaletteEmpty
CommandPaletteFooter
CommandPaletteGroup
CommandPaletteInput
CommandPaletteItem
CommandPaletteList
DateInput
Dialog
AlertDialog
Dialog
DialogHeader
useXDSImperativeAlertDialog
useXDSImperativeDialog
Divider
DropdownMenu
DropdownMenu
DropdownMenuDivider
DropdownMenuItem
DropdownMenuItemData
DropdownMenuSection
EmptyState
Field
Field
FieldLabel
FieldStatus
Heading
HoverCard
Icon
Kbd
Layout
Center
FormLayout
Grid
GridSpan
HStack
Layout
LayoutContainer
LayoutContent
LayoutFooter
LayoutHeader
LayoutPanel
Section
StackItem
VStack
Link
List
List
ListItem
Markdown
MetadataList
MetadataList
MetadataListItem
MobileNav
MoreMenu
NavIcon
NavMenuItem
NumberInput
OverflowList
Pagination
Popover
PowerSearch
ProgressBar
Radio
RadioList
RadioListItem
Resizable
ResizeHandle
useXDSResizable
SegmentedControl
SegmentedControl
SegmentedControlItem
SelectableCard
Selector
MultiSelector
Selector
SelectorOption
SideNav
SideNav
SideNavCollapseButton
SideNavHeading
SideNavItem
SideNavSection
Skeleton
Slider
Spinner
StatusDot
Switch
Table
BaseTable
Table
TableCell
TableHeaderCell
TableRow
useXDSTableColumnSettings
useXDSTablePagination
useXDSTableSelection
useXDSTableSelectionState
useXDSTableSortable
Tabs
Tab
TabList
TabMenu
Text
TextArea
TextInput
Thumbnail
TimeInput
Timestamp
Toast
Toast
useXDSToast
Token
Tokenizer
Toolbar
Tooltip
TopNav
TopNav
TopNavHeading
TopNavItem
TopNavMegaMenu
TopNavMegaMenuFeaturedCard
TopNavMegaMenuItem
TopNavMenu
TreeList
Typeahead
BaseTypeahead
Typeahead
TypeaheadItem
useXDSHoverCard
useXDSPopover
useXDSTooltip
Utilities
Utilities
LinkProvider
MediaTheme
SyntaxTheme
Theme
useClickableContainer
useEntryAnimation
useFocusTrap
useGridFocus
useImageMode
useInputContainer
useListFocus
useMediaQuery
useOverflow
useScrollLock
useScrollOverflow
useXDSLayer
useXDSStreamingText
Terms of UsePrivacy Policy
Type to search
↑↓Navigate↵SelectEscClose
SideNav@xds/core v0.0.13 · XDSSideNav

Usage

A sidebar navigation component for organizing application pages with sections, nested items, and icons. Use SideNav as the primary navigation when an app has 5 or more destinations or requires hierarchical grouping.
ts
import {XDSSideNav} from '@xds/core/SideNav'

Best practices

GuidancePractices
DoUse sections to group related navigation items and help users scan for their destination.
DoPair outline and filled icon variants so the selected state is visually distinct.
Don'tInclude a SideNavHeading when a TopNav is already providing app identity — this duplicates branding.
Don'tUse for filtering content — use tabs or filter buttons instead.

Sub-components

SideNav is a compound component with 5 sub-components.

XDSSideNav

Container with five zones: header, topContent, children (scrollable), footer, and footerIcons. Supports collapsible mode.
PropTypeDescription
header
ReactNodeHeader area (typically XDSSideNavHeading). Sticky.
topContent
ReactNodeContent below the header, e.g., a create button.
children
ReactNodeNavigation sections and items. Scrollable.
footer
ReactNodeFooter area above the icon bar.
footerIcons
ReactNodeFooter icon bar.
collapsible
boolean | { defaultIsCollapsed?: boolean; isCollapsed?: boolean; onCollapsedChange?: (isCollapsed: boolean) => void; hasButton?: boolean; buttonLabel?: string } (default: false)Enables collapse behavior. true for uncontrolled with default toggle button, or an object for controlled mode and advanced config (defaultIsCollapsed, isCollapsed + onCollapsedChange, hasButton, buttonLabel).
xstyle
StyleXStylesStyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value — not an inline style object like style={{}}.

XDSSideNavCollapseButton

Toggle button for sidenav collapse. Place inside XDSSideNav (reads context automatically) or outside (pass sideNavRef). Renders as an icon-only ghost button by default.
PropTypeDescription
sideNavRef
RefObject<HTMLElement | null>Ref to the XDSSideNav element. Only needed when the button is rendered outside the sidenav.
label
stringCustom button label. When provided, renders as a text button with chevron. When omitted, renders icon-only.
children
ReactNodeCustom button content. Overrides the default chevron icon and label.

XDSSideNavHeading

Product/suite/account heading with smart interaction boundary logic for links and a menu popover.
PropTypeDescription
headingrequired
stringProduct/app name.
icon
ReactNodeProduct/app icon.
headingHref
stringLink for the heading.
superheading
stringText above the heading.
superheadingHref
stringLink for the superheading.
subheading
stringText below the heading.
subheadingHref
stringLink for the subheading.
menu
ReactNodeMenu content rendered inside a popover.
headerEndContent
ReactNodeContent rendered at the trailing edge of the heading row, between text and chevron. Useful for badges, status indicators, or compact action buttons. Hidden when collapsed.

XDSSideNavItem

Navigation item with icon, selected state, optional end content, and nesting support via children.
PropTypeDescription
labelrequired
stringItem label.
as
XDSLinkComponentTypeCustom link component.
icon
XDSIconTypeIcon displayed in the outline (unselected) variant. See `npx xds docs icons` for valid semantic names.
selectedIcon
XDSIconTypeIcon displayed when the item is selected (filled variant). See `npx xds docs icons` for valid semantic names.
isSelected
boolean (default: false)Marks this item as the current page.
isDisabled
boolean (default: false)Disabled state.
href
stringNavigation URL.
onClick
(e: MouseEvent) => voidClick handler.
endContent
ReactNodeRight-side content such as badges or counts.
children
ReactNodeSub-items for nesting.
collapsible
boolean | { defaultIsCollapsed?: boolean, isCollapsed?: boolean, onCollapsedChange?: (isCollapsed: boolean) => void } (default: false)Enables collapse behavior for items with children. Pass true for uncontrolled (starts expanded), or an object for controlled mode.

XDSSideNavSection

Section grouping with an optional title, subtitle, and end content.
PropTypeDescription
titlerequired
stringSection title.
subtitle
stringSection subtitle.
children
ReactNodeSection items.
endContent
ReactNodeRight-side content in the section header.
isHeaderHidden
boolean (default: false)Visually hides the section header while keeping it accessible to screen readers.
xstyle
StyleXStylesStyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value — not an inline style object like style={{}}.

Examples

Common configurations, variations, and states.
SideNav — End Content
Side navigation items with badges, counts, and context menus as trailing content.
SideNav — Nested Items
Side navigation with collapsible nested items for settings or hierarchical menus.
SideNav — Header with Menu
Side navigation with an account switcher dropdown in the header for multi-account apps.