Component docs
Loading
"use client";
import { SideNav } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
items (required) | readonly PixxlNavItem[] | — | Items with href render links (through PixxlProvider linkComponent), items without one render buttons that select them. |
defaultValue | string | null | — | Selected item id when uncontrolled. |
onValueChange | (value: string) => void | — | Called with the id of the activated item. |
renderLink | PixxlRenderLink<PixxlNavItem> | — | Per-component link override (see PixxlRenderLink). |
value | string | null | — | Id of the current item (aria-current="page"); null for none. |
itemsrequiredreadonly PixxlNavItem[]
Items with href render links (through PixxlProvider linkComponent), items without one render buttons that select them.
defaultValuestring | null
Selected item id when uncontrolled.
onValueChange(value: string) => void
Called with the id of the activated item.
renderLinkPixxlRenderLink<PixxlNavItem>
Per-component link override (see PixxlRenderLink).
valuestring | null
Id of the current item (aria-current="page"); null for none.
Other props are passed to the root element (HTMLAttributes<HTMLElement>), including className, style, id and aria-* attributes.
const items = [
{ id: "docs", label: "Docs", href: "/docs" },
{ id: "blog", label: "Blog", href: "/blog" },
];
<SideNav items={items} />