SidebarNavItem
Navigation & Chrome

SidebarNavItem

Render a navigation link or button with optional icon and badge.

SidebarNavItem renders an anchor when href is set and a button otherwise. active applies selected styling and aria-current="page". Omit icon to remove the icon column.

Import

TSX
import { SidebarNavItem } from "@solarius/onset";

Props

SidebarNavItemProps props
PropTypeDefaultDescription
iconReactNode—Icon displayed before the label.
childrenReactNode—Label text.
activeboolean—Highlights the item as the current page.
countReactNode—Count badge displayed on the right.
countTone"default" | "warn""default"Accent color for the count badge.
hrefstring—If provided, renders as an <a> instead of a <button>.

Example

SidebarNavItem