MiHCM
navigation/@mihcm/ui·v0.21.0·stable

Main Sidebar

Figma-style main app sidebar. Compact 46px desktop rail, mobile bottom menu, expandable drilldown panel with icon, title, description, badges, nested levels, and custom panel slots. IconSidebar remains as a compatibility alias.

Props

The full prop API for Main Sidebar. Same surface in web and React Native — bundlers pick the right variant via the react-native export condition.

PropTypeDefaultDescriptionSince
itemsMainSidebarItem[]Navigation tree. Items support `icon`, `label`, `description`, `badge`, `children`, and custom `panel` content.0.4.0
activeKeystringKey of the active item.0.4.0
onItemSelect(key: string, item: MainSidebarItem) => voidFired when an item is activated.0.4.0
expandedbooleanControlled expanded state for the drilldown panel.0.9.0
defaultExpandedbooleanfalseInitial uncontrolled expanded state.0.9.0
headerReactNodeLeading slot above the items (logo).0.4.0
footerReactNodeTrailing slot at the bottom (settings cog).0.4.0
panelHeader / panelFooterReactNodeExpanded panel slots for custom headings, actions, summaries, or status badges.0.9.0
side'left' | 'right''left'Desktop placement. Use `right` when the sidebar docks to the right edge; the rail stays outside and the panel opens inward.0.9.0
mobilebooleanfalseForces the responsive bottom navigation pattern for documentation previews, tests, and mobile-only shells.0.10.1
pinnablebooleanfalseDrilldown only — show a pin/unpin toggle in the panel header. Pinning keeps a chosen section’s sub-panel open across navigation, remounts, and outside-clicks until explicitly unpinned.0.21.0
pinnedKey / defaultPinnedKeystringControlled / uncontrolled key of the pinned section. A controlled `pinnedKey` round-trips through `onPinnedKeyChange`, so it can be persisted (e.g. localStorage) and survive a reload.0.21.0
onPinnedKeyChange(key: string | undefined) => voidFired when the user pins/unpins via the header toggle. `undefined` = unpinned.0.21.0
pinLabel / unpinLabelstring'Pin menu' / 'Unpin menu'A11y labels / tooltips for the pin toggle in its unpinned / pinned state.0.21.0
railClassName / panelClassName / itemClassName / activeItemClassNamestringTokenized Tailwind override hooks merged with the default rail, panel, and item styles.0.9.0

Import

import { MainSidebar } from '@mihcm/ui/MainSidebar';