Zephora UI

Navigation

Sidebar

App drawer rendered as an in-flow <aside> (inline mode) or a portaled modal panel (overlay mode), with header/body/footer sections and a mini collapsed rail.

Import

import { Sidebar, SidebarHeader, SidebarBody, SidebarFooter } from "@zephora/react";

Examples

Inline layout

Inline mode participates in normal flow — place it next to your content.

Content

Collapsed rail

Inline sidebars can shrink to a mini rail via `collapsed`.

Content

API

Sidebar props

PropTypeDefaultDescription
mode"inline" | "overlay""inline"Rendering mode: in-flow <aside> or a portaled modal drawer with backdrop and focus trap.
openbooleanControlled open state.
defaultOpenbooleantrueInitial open state when uncontrolled.
onOpenChange(open: boolean) => voidCalled when the open state changes.
side"start" | "end""start"Which inline edge the sidebar sits on.
widthnumber | string"16rem"Expanded width. Numbers are px.
collapsedWidthnumber | string"4rem"Width in collapsed (mini rail) mode.
collapsedbooleanfalseMini rail mode (inline only).
unstyledbooleanfalseHeadless mode — skips Zephora styling.

SidebarHeader / SidebarBody / SidebarFooter props

PropTypeDefaultDescription
unstyledbooleanfalseHeadless mode — skips Zephora styling.
…restHTMLAttributes<HTMLDivElement>All native div props are forwarded. Body scrolls; header and footer stay fixed.

Keyboard

KeyAction
EscapeCloses the sidebar in overlay mode (focus is trapped inside while open).