Skip to content

Sidebar

Collapsible vertical navigation sidebar (<aside>), with main and bottom item sections and a built-in collapse toggle.

items accepts either a real array or a JSON string, so it works directly as a plain HTML attribute. Items with section: 'bottom' render in the footer area.

<and-sidebar
items='[{"id":"home","label":"Home"},{"id":"docs","label":"Docs"},{"id":"settings","label":"Settings","section":"bottom"}]'
active-item="home"
></and-sidebar>
PropertyAttributeDescriptionTypeDefault
activeItemactive-itemThe active navigation item ID.string'home'
ariaNavLabelaria-nav-labelARIA label for the navigation.string'Sidebar navigation'
collapsedcollapsedWhether the sidebar is collapsed (desktop).booleanfalse
collapsedWidthcollapsed-widthCollapsed width of the sidebar.string'4rem'
expandedWidthexpanded-widthExpanded width of the sidebar.string'16rem'
itemVariantitem-variantVisual style for individual sidebar items."default" | "filled" | "underline"'default'
itemsitemsNavigation items. Items with section: 'bottom' render in the footer area.SidebarItem[] | string[]
mobileBreakpointmobile-breakpointBreakpoint (px) below which the sidebar auto-collapses on mobile.number768
mobileCollapsemobile-collapseEnable auto-collapse on mobile viewports.booleantrue
variantvariantVisual variant of the sidebar."default" | "filled" | "floating" | "glass"'default'
EventDescriptionType
andSidebarItemClickEmitted when a navigation item is clicked.CustomEvent<string>
andSidebarToggleEmitted when the sidebar collapse state changes.CustomEvent<boolean>