ValyroUI English version

Sidebar

Боковая панель. Бесплатно, MIT · Навигация и каркас › Каркас

Установка

npx valyro-cli@latest add sidebar
npx shadcn@latest add https://valyro.xyz/r/sidebar.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { Sidebar } from 'valyro-ui';

Пропсы

PropTypeDefault
sectionsSidebarSection[]Groups of nav items, each with an optional heading (a divider in collapsed mode). Or compose them as children: Sidebar.Section with Sidebar.Items (nested Items make a collapsible group).
childrenReactNodeThe compound form instead of sections: Sidebar.Section elements.
valuestringId of the active item.
defaultValuestringInitial value when uncontrolled.
onValueChange(id: string) => voidCalled with the new value when it changes.
collapsedbooleanfalseIcons-only rail; labels move into tooltips and groups into flyout menus.
headerReactNodeFixed slot above the navigation, e.g. a logo or workspace switcher.
footerReactNodeFixed slot below the navigation, e.g. the user menu.
labelstring'Sidebar'Accessible name of the navigation.

Составные части

Sidebar.Section (SidebarSectionPart), Sidebar.Item (SidebarItemPart)

Похожие компоненты

Назад: Navbar · Далее: Resizable Panels · Весь раздел «Навигация и каркас»