Navigation & Disclosure
Sidebar
Sidebar provides a collapsible application navigation rail. Organize content into understandable destinations and reveal detail when it becomes relevant. Keep the active location or expanded state easy to recognize. Import it from @/components/kamod-ui/sidebar.
Source · API reference · Theming · Styles
Installation
Import SidebarProvider and sidebar primitives from @/components/kamod-ui/sidebar.
pnpm add @kamod-ch/uiCopy an example with @kamod-ch/ui or the matching @kamod-ch/ui/… subpath. The code block switches between those two installs. Connect The Global Theme CSS and Tailwind Source Detection before your first render.
Usage
Wrap the layout in SidebarProvider, render Sidebar next to SidebarInset, and toggle with SidebarTrigger.
import { Sidebar } from "@kamod-ch/ui";Choose a complete composition from the examples below; required child components and props vary by pattern.
Component Examples & Variants
Explore Sidebar in Different Contexts, from the starting pattern to the compositions below. Begin with Basic Sidebar, then compare the examples that match your content, state and layout. These are working patterns to adapt, not a list of interchangeable variant values: check the API Reference before using a prop or combining behaviors. Look at the surrounding labels, supporting text and spacing as well as the component itself.
Read the Result and Its Implementation Together. Use each showcase’s Code view to inspect imports and composition, or its Prompt view to prepare a setup or adaptation brief. Try the narrow preview and local theme controls before connecting real data, and use Reset to return an example to its initial state. Keep layout changes in class utilities where appropriate; follow the Component Styles Guide for hierarchy and the Theming Guide for shared surfaces and colors. The Accessibility Notes explain what to preserve when making those changes.
Props and Data
Configure Sidebar using the contracts below. Read the documented options alongside the Source Definitions to understand which values your application supplies and which details the component owns. Start with a prop or helper, then follow its type link to inspect the declaration without leaving the page.
Props, slots and variants for this component.
Type cards are extracted from this checkout’s TypeScript source at build time. Props inherited through HTMLAttributes, Omit or variant helpers remain references in those declarations; their fields are not flattened here. Match the reference to your installed version, and check a package’s exports before writing an import type. A type exported by a source file is not necessarily re-exported by @kamod-ch/ui.
Component Props
? means a field can be omitted; it does not promise a fallback value. Existing documented defaults remain alongside the descriptions. For callbacks, check the argument and return types before connecting your own state or services.Data Type Reference
Expand a card to inspect and copy the exact declaration. The code header identifies its repository file; follow imported or inherited types in the Implementation Source when you need the complete dependency chain. Required-field summaries cover fields declared directly in that type. Source-only helpers and inferred schema outputs describe the local implementation, not additional props you can pass to every component.
Sidebar Props
4 declared fieldsSidebarPropsSidebar.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarProps before adapting it.SidebarContent Props
1 declared fieldSidebarContentPropsSidebarContent.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarContentProps before adapting it.SidebarFooter Props
1 declared fieldSidebarFooterPropsSidebarFooter.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarFooterProps before adapting it.SidebarInput Props
DeclarationSidebarInputPropsSidebarGroup.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarInputProps before adapting it.SidebarSeparator Props
DeclarationSidebarSeparatorPropsSidebarGroup.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarSeparatorProps before adapting it.SidebarGroup Props
1 declared fieldSidebarGroupPropsSidebarGroup.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarGroupProps before adapting it.SidebarGroupLabel Props
2 declared fieldsSidebarGroupLabelPropsSidebarGroup.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarGroupLabelProps before adapting it.SidebarGroupAction Props
2 declared fieldsSidebarGroupActionPropsSidebarGroup.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarGroupActionProps before adapting it.SidebarGroupContent Props
1 declared fieldSidebarGroupContentPropsSidebarGroup.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarGroupContentProps before adapting it.SidebarHeader Props
1 declared fieldSidebarHeaderPropsSidebarHeader.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarHeaderProps before adapting it.SidebarInset Props
1 declared fieldSidebarInsetPropsSidebarInset.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarInsetProps before adapting it.SidebarMenu Props
1 declared fieldSidebarMenuPropsSidebarMenu.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarMenuProps before adapting it.SidebarMenuItem Props
1 declared fieldSidebarMenuItemPropsSidebarMenu.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarMenuItemProps before adapting it.SidebarMenuButton Props
4 declared fieldsSidebarMenuButtonPropsSidebarMenu.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarMenuButtonProps before adapting it.SidebarMenuAction Props
3 declared fieldsSidebarMenuActionPropsSidebarMenu.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarMenuActionProps before adapting it.SidebarMenuBadge Props
1 declared fieldSidebarMenuBadgePropsSidebarMenu.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarMenuBadgeProps before adapting it.SidebarMenuSkeleton Props
1 declared fieldSidebarMenuSkeletonPropsSidebarMenu.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarMenuSkeletonProps before adapting it.SidebarMenuSub Props
1 declared fieldSidebarMenuSubPropsSidebarMenu.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarMenuSubProps before adapting it.SidebarMenuSubItem Props
1 declared fieldSidebarMenuSubItemPropsSidebarMenu.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarMenuSubItemProps before adapting it.SidebarMenuSubButton Props
4 declared fieldsSidebarMenuSubButtonPropsSidebarMenu.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarMenuSubButtonProps before adapting it.SidebarContextValue
7 declared fieldsSidebarContextValueSidebarProvider.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarContextValue before adapting it.state, open, setOpen, openMobile, setOpenMobile, isMobile, toggleSidebarSidebarProvider Props
4 declared fieldsSidebarProviderPropsSidebarProvider.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarProviderProps before adapting it.SidebarRail Props
DeclarationSidebarRailPropsSidebarRail.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarRailProps before adapting it.SidebarTrigger Props
1 declared fieldSidebarTriggerPropsSidebarTrigger.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of SidebarTriggerProps before adapting it.Accessibility
Sidebar includes a labeled SidebarTrigger and uses Sheet for its mobile overlay. Desktop collapse and mobile open state serve different layouts. Navigation links still require application-supplied destinations, labels and current-page semantics.
You have the pieces. Put them into one real interaction, keep its state in one place, and check the result with the content your application will actually show.
Connect the Foundation
Return to Choose and Compose Components to connect this reference to a working screen. Keep global CSS in one entrypoint and import only the components that screen needs.
Build the Surrounding Screen
Find a neighboring interaction in the Component Library, or start with a complete Block. Replace sample content and destinations before refining the layout; a local class change can stay with the composition.
Make the Result Hold Up
Use shared theme roles for changes that belong everywhere. Then review the whole journey: keyboard focus, long labels, narrow screens and a clear way to recover when something fails.
Keep a link to the source and note your intentional changes. Your next edit should begin with a clear decision, not another search.