Skip to content

Side Nav

@astryxdesign/core v0.7.1 · SideNav

SideNav Props ​

NameTypeDefaultDescription
labelstringLocalized “Sidebar”Accessible name of the navigation landmark.
collapsibleboolean | SideNavCollapsiblefalseAllows the icon rail. An object can set the initial state, the built-in button, and a hotkey.
isCollapsedboolean-Controlled collapsed state for v-model:is-collapsed.
resizableboolean | SideNavResizablefalseDrag the trailing edge. An object can set the starting, minimum, and maximum widths, and an autoSaveId that remembers the width.
handleRefHandleRef<SideNavHandle>-A button outside the bar can collapse, expand, and toggle. Sharing v-model:is-collapsed is the usual approach.

SideNav events ​

NameDescription
update:isCollapsedCollapsed state change for v-model:is-collapsed.
collapsedChangeFired whenever the collapsed state changes.
widthChangeFired while dragging, with the width in pixels.

SideNav slots ​

NameDescription
defaultMain navigation, usually sections and items.
headerBrand block at the top.
topExtra content under the brand block.
footerFooter content, above the collapse button.
footerIconsIcons on the same row as the collapse button.

SideNavSection Props ​

NameTypeDefaultDescription
titlestring-Group title. Stays available to assistive tech when collapsed.
subtitlestring-Supporting line under the title.
isHeaderHiddenbooleanfalseHides the title visually.

SideNavItem Props ​

NameTypeDefaultDescription
labelstring-Item name.
hrefstring-Destination. With children, the label navigates and the chevron collapses.
asNavLinkComponent'a'Link root.
iconClassstring-CSS icon class. Items without an icon are omitted while collapsed.
isSelectedbooleanfalseCurrent page.
isDisabledbooleanfalseDisables the item.
collapsibleboolean | object-Whether children can collapse. false keeps them open.

SideNavItem slots ​

NameDescription
defaultChild items.
iconIcon before the label.
selectedIconIcon shown while the item is selected.
endContent at the end of the primary control, still inside the link or button.
actionsControls beside the primary control, such as an icon button. They stay outside the link and are omitted while the rail is collapsed.

SideNavHeading Props ​

NameTypeDefaultDescription
headingstring-Product or app name.
headingHrefstring-Link for the main title.
superheadingstring-Small line above the title.
superheadingHrefstring-Link for the line above the title.
subheadingstring-Small line below the title.
subheadingHrefstring-Link for the line below the title.
logoLabelstring-Accessible name when the logo is a link on its own. Falls back to heading.
asNavLinkComponent'a'Link root.

SideNavHeading slots ​

NameDescription
iconMark in front of the title. This is all that remains while collapsed.
endTrailing content on the title row.
menuPopup menu, usually a NavHeadingMenu. The scope provides close and focusRequest.

SideNavCollapseButton Props ​

Toggles the rail between its expanded and collapsed states. Inside a SideNav it reads the collapse state from the sidebar; outside one, bind it with v-model:is-collapsed.

NameTypeDefaultDescription
labelstring-Button text. With a label the button renders the chevron plus the text; without one it is icon only and the translated “Collapse sidebar” / “Expand sidebar” becomes its accessible name.
collapsibleSideNavControlledCollapsible-Controlled { isCollapsed, onCollapsedChange } config, for buttons rendered outside the sidebar. Pass the same object to SideNav. It wins over isCollapsed.
isCollapsedboolean-Controlled collapsed state for v-model:is-collapsed, for buttons rendered outside the sidebar.
size'sm' | 'md' | 'lg'Container: sm in a SideNav, otherwise mdButton size. Set it when the button sits outside a sized container and has to match its neighbours.

SideNavCollapseButton slots ​

NameDescription
defaultCustom content for the button's icon slot. Replaces the chevron; the visible text still comes from label.