Sidebar: Variants
variant sets the look: a full-height sidebar, a floating panel, or inset, where the page becomes a card on the sidebar color. Switch between them to see the layout animate.
This adds the example as components/examples/sidebar/variants.tsx, together with the Sidebar component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/sidebar-variants.jsonTo add only the component, follow the Sidebar installation.
Props in this example
The Sidebar props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
variantplain drops the surface, the edge line, the scrollbar and the gap between menu items, for a sidebar that sits on the page. | "sidebar" | "floating" | "inset" | "plain" | "sidebar" |
| Prop | Type | Default |
|---|---|---|
isActiveHighlights it and sets aria-current="page". | boolean | false |
Every prop is in the Sidebar API reference.
See them all, with keyboard support and accessibility notes, on the Sidebar page.
- ButtonButtons in every variant and size, with a built-in loading, success and error flow that skips the spinner for fast requests.
- HotkeyParse, label, announce and match keyboard shortcuts, with ⌘ on Apple platforms and Ctrl everywhere else.
- InputA text input with three sizes, invalid and read-only states, native validation styling and a 16px touch font so phones never zoom in.
- SheetA panel that slides in from any edge, with swipe-to-dismiss, scroll lock and stacked nesting.
- SkeletonPlaceholders that wait 150ms before showing, take the exact size of the content they wrap, and fade it in without moving anything.
- TooltipA short hint on hover or keyboard focus that opens after a brief rest, switches instantly between neighbours and shows shortcuts.