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
activeKeystring—Key of the active item.0.4.0
onItemSelect(key: string, item: MainSidebarItem) => void—Fired when an item is activated.0.4.0
expandedboolean—Controlled expanded state for the drilldown panel.0.9.0
defaultExpandedbooleanfalseInitial uncontrolled expanded state.0.9.0
headerReactNode—Leading slot above the items (logo).0.4.0
footerReactNode—Trailing slot at the bottom (settings cog).0.4.0
panelHeader / panelFooterReactNode—Expanded 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 / defaultPinnedKeystring—Controlled / 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) => void—Fired 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 / activeItemClassNamestring—Tokenized Tailwind override hooks merged with the default rail, panel, and item styles.0.9.0

Import

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