# Hulian UI (`@hulianui/ui`) - Complete Component Documentation > A polished, practical React design system built with Base UI, Tailwind CSS v4, and Motion · v0.68.0 · 401 self-contained component guides Install with `npm i @hulianui/ui @hulianui/tokens`; tokens supplies the required theme CSS. Import from the root barrel with `import { X } from "@hulianui/ui"`, or use the matching `@hulianui/ui/` subpath for a small component set. # ━━━━━━━━ Layout ━━━━━━━━ # AdminLayout **Exports**: `AdminLayout` > Admin application shell · Collapsible branded sidebar with NavMenu + header with collapse control, breadcrumbs, and actions + multi-tab navigation with controlled routing or automatic menu-driven state + content area built from NavMenu, ScrollArea, and Popover · layout/container ## When to use Use AdminLayout when you need a complete admin shell with a sidebar menu, header, and multi-tab keep-alive navigation out of the box. Provide `menuItems` and `children` to get started. If you need full control over each region, no built-in tab behavior, or a more composable foundation, use [Layout](https://hulianui.haloritual.com/components/layout) instead. ## Import ```ts import { AdminLayout } from "@hulianui/ui" ``` ## Props | Name | Type | Default | Description | |------|------|------|------| | menuItems* | `NavMenuNode[]` | - | Sidebar menu data rendered with NavMenu. | | selectedKey | `string` | - | Controlled selected menu item key. | | defaultSelectedKey | `string` | - | Initial selected menu item key when uncontrolled. | | openKeys | `string[]` | - | Controlled keys for expanded submenus. | | defaultOpenKeys | `string[]` | - | Initial expanded submenu keys when uncontrolled. | | collapsed | `boolean` | - | Controlled sidebar collapse state. | | defaultCollapsed | `boolean` | `false` | Initial sidebar collapse state when uncontrolled. | | breakpoint | `"sm"\|"md"\|"lg"\|"xl"\|"2xl"\|number` | - | Responsive breakpoint with the same semantics as LayoutSider. The sidebar collapses when the viewport is at or below this width and expands above it. In uncontrolled mode, the component updates its own state. When `collapsed` is passed, it only calls `onCollapsedChange`; the consumer decides whether to apply the new state. Omit this prop to disable automatic collapsing. | | showTabs | `boolean` | `true` | Whether to show the tab bar. | | tabs | `AdminTab[]` | - | Controlled tab list. When omitted, menu selections maintain the list automatically. | | activeKey | `string` | - | Controlled active tab key. | | defaultActiveKey | `string` | - | Initial active tab key when uncontrolled; it also determines which tab opens on first render. | | fitViewport | `boolean` | `true` | Whether the shell fills the viewport. Keep `true` for a full-page application: the shell uses a fixed 100dvh height and scrolls inside the content area. Pass `false` inside a fixed-height preview or container and use `h-full` to follow the parent height. | | className | `string` | - | Additional class name for the root container. | | contentClassName | `string` | - | Additional class name for the content area. | `AdminTab` has the shape `{ key: string; label: ReactNode; closable?: boolean }`. By default, `closable` allows a tab to close when more than one tab is open; the final tab cannot be closed. The tab bar is the standalone [RouteTabs](https://hulianui.haloritual.com/components/route-tabs) component. RouteTabs provides the context menu, pinned tabs, drag-and-drop ordering, and automatic scrolling of the active tab into view; AdminLayout simply embeds it in the shell. Use RouteTabs directly when composing your own shell. ## Events | Event | Type | Description | |------|------|------| | onMenuSelect | `(key: string, item: NavMenuItem) => void` | Called when a leaf menu item is selected. | | onOpenChange | `(openKeys: string[]) => void` | Called when the expanded submenu keys change. | | onCollapsedChange | `(collapsed: boolean) => void` | Called when the sidebar collapse state changes. | | onTabChange | `(key: string) => void` | Called when the active tab changes. | | onTabClose | `(key: string) => void` | Called when a tab is closed. | | onTabsAction | `(action, tabKey, affectedKeys) => void` | Called for context-menu actions such as close others, close left/right/all, or refresh. The third argument contains the keys actually affected by the action. ⚠️ **This is the only update path when `tabs` is controlled**: without this handler, these actions cannot change the consumer-owned tab list. | ## Slots | Slot | Type | Description | |------|------|------| | children | `ReactNode` | Main content for the active page, selected by the application from `activeKey`. | | logo | `ReactNode` | Brand area (expanded). | | logoCollapsed | `ReactNode` | Brand area (collapsed, logo reused by default). | | breadcrumb | `ReactNode` | Top bar breadcrumb area. | | headerExtra | `ReactNode` | Extension area on the right side of the top bar (user menu/notification/theme switching, etc.). | ## Example ```tsx const [active, setActive] = useState("dashboard"); HulianUI Admin} logoCollapsed={H} breakpoint="md" // Collapse the sidebar automatically at ≤768px defaultActiveKey="dashboard" defaultSelectedKey="dashboard" defaultOpenKeys={["users"]} onTabChange={setActive} breadcrumb={Home / {active}} headerExtra={} > ``` ## Usage guidelines - **Treat `logoCollapsed` as required whenever `collapsible` is on.** A collapsed sider is only 64px wide, so without a narrow mark the full logo gets clipped in half by `overflow-hidden`. Nothing throws, it just looks broken, so a development warning fires once (#121). A first glyph, a monochrome icon, or a square mark all work. - **Put [Brand](../brand/brand.en.md) directly in the brand area**: `logo={}` and `logoCollapsed={}`. Animated or video logos also go through Brand's `mark` (GIF, `` reduced-motion fallbacks, and muted `