Saltar al contenido
El Muestrario

componente · @solu30/ui-kit/navigation

SidebarNavigation

Navegación lateral completa, con grupos, badges, modo colapsado y cajón para pantallas chicas.

Seguir leyendo — 2 párrafos más

SidebarNavigation provides a responsive sidebar with collapsible mode, mobile drawer overlay, grouped items, badges, and keyboard navigation.

Theming via CSS variables:

  • --ui-accent: active item highlight color
  • --ui-bg-base: page background
  • --ui-bg-raised: sidebar background
  • --ui-bg-overlay: mobile overlay background
  • --ui-content-primary: primary text color
  • --ui-content-secondary: muted text color
  • --ui-border: border color

9 sitios de import en 4 de 15 verticales — un archivo que la importa cuenta una vez, monte una instancia o veinte.

  • carlosmartinpavon
  • dietaly
  • elliot
  • zentrya

La pieza, con lugar de pantalla

Cargando el espécimen…

Cómo se usa

import { SidebarNavigation } from '@solu30/ui-kit/navigation'

Props

13 props declaradas en los tipos de la versión instalada.
PropRequeridaTipoQué hace
groupsopcionalSidebarNavGroup[]Navigation groups containing items (primary API). Provide either `groups` or `items`, not both.
itemsopcionalSidebarNavItem[]Flat items shorthand — automatically wrapped in a single unlabeled group. Provide either `items` or `groups`, not both.
activeItemIdopcionalstringID of the currently active item
collapsedopcionalbooleanWhether the sidebar is collapsed (icons only) — controlled mode
defaultCollapsedopcionalbooleanInitial collapsed state for uncontrolled mode (ignored when `collapsed` is provided)
onCollapsedChangeopcional(collapsed: boolean) => voidCallback when collapsed state changes
headeropcionalReactNode | { title: string; subtitle?: string; }Header slot (logo/brand area). Accepts either a ReactNode or a plain object `{ title, subtitle? }` for a default header layout.
footeropcionalReactNodeFooter slot (user menu area)
onItemClickopcional(item: SidebarNavItem) => voidCallback when a nav item is clicked
classNameopcionalstringAdditional class names
mobileOpenopcionalbooleanWhether the mobile drawer is open
onMobileOpenChangeopcional(open: boolean) => voidCallback when mobile drawer state changes
appearanceopcional"boxed" | "plain"Visual style variant for items. (ADR-079) - "boxed" (default): current behavior — icon in a rounded box bg, padded items. All existing consumers use this implicitly. Zero breaking change. - "plain": compact list style — icon rendered loose (no background box), reduced vertical padding, items tighter together. Active state is subtle (text-primary + very light bg tint). Enables `childGroups` section headers. ADR-003: both variants use only cmpPreset tokens.

Ejemplo del paquete

<SidebarNavigation
  groups={[
    {
      label: 'Main',
      items: [
        { id: 'dashboard', label: 'Dashboard', href: '/', icon: HomeIcon },
        { id: 'orders', label: 'Orders', href: '/orders', icon: BoxIcon, badge: 5 },
      ],
    },
  ]}
  activeItemId="dashboard"
  header={<Logo />}
  footer={<UserMenu />}
/>

Del @example del JSDoc de @solu30/ui-kit, sin editar: son 65 de los 541 símbolos. La sangría y los renglones en blanco son los del paquete.