Sidebar
Primary navigation on the --side surface, extracted from the mockup’s .side, .navwrap, .navgroup and .nav.
Interactive Preview
Section titled “Interactive Preview”import { Sidebar, SidebarGroup, SidebarGroupLabel, SidebarItem } from "@/components/ui/sidebar";
<Sidebar aria-label="Main navigation"> <SidebarGroup> <SidebarGroupLabel>Workspace</SidebarGroupLabel> <SidebarItem href="/schedule" active>Settings</SidebarItem> <SidebarItem href="/activity">Activity</SidebarItem> </SidebarGroup></Sidebar><script lang="ts"> import Sidebar from "@/components/ui/sidebar.svelte"; import SidebarGroup from "@/components/ui/sidebar-group.svelte"; import SidebarGroupLabel from "@/components/ui/sidebar-group-label.svelte"; import SidebarItem from "@/components/ui/sidebar-item.svelte";</script>
<Sidebar aria-label="Main navigation"> <SidebarGroup> <SidebarGroupLabel>Workspace</SidebarGroupLabel> <SidebarItem href="/schedule" active>Settings</SidebarItem> <SidebarItem href="/activity">Activity</SidebarItem> </SidebarGroup></Sidebar>import { Sidebar, SidebarGroup, SidebarGroupLabel, SidebarItem } from "@/components/ui/sidebar";
<Sidebar aria-label="Main navigation"> <SidebarGroup> <SidebarGroupLabel>Workspace</SidebarGroupLabel> <SidebarItem href="/schedule" active>Settings</SidebarItem> <SidebarItem href="/activity">Activity</SidebarItem> </SidebarGroup></Sidebar>Installation
Section titled “Installation”npx @glaceon/cli add sidebar --framework react # or svelte, solidNo headless dependency, only the design tokens:
bun add @glaceon/tokensReact and Solid export all four parts from one module. Svelte needs one import per part (Sidebar.svelte, SidebarGroup.svelte, SidebarGroupLabel.svelte, SidebarItem.svelte).
Tokens
Section titled “Tokens”The sidebar tokens already exist in @glaceon/tokens, in both themes and mapped into the theme as --color-side*.
| Token | Light | Dark | Used for |
|---|---|---|---|
--side |
#0B6E43 |
#0A1A13 |
Sidebar surface. |
--side-ink |
#E6F5EC |
#DDEFE5 |
Item text. |
--side-muted |
#C2E5D2 |
#7FA793 |
Group labels. |
--side-active |
#0F844F |
#1E5E40 |
Active item fill. |
--side-muted and --side-active were both darkened from the mockup so they clear WCAG AA: 3.75:1 and 3.97:1 respectively were failures, 4.64:1 and 4.74:1 pass. --side-active is aligned with the brand --green so an active item is the same green everywhere in the system.
Active state
Section titled “Active state”The active item is driven by aria-current="page", not a class, so the styling and the announcement cannot drift apart.
| Prop | Applied styling |
|---|---|
active |
Sets aria-current="page", which the item styles through aria-[current=page]:bg-side-active aria-[current=page]:text-white. |
| hover (any item) | hover:bg-white/10. |
API Reference (Props)
Section titled “API Reference (Props)”| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
Sidebar |
class |
string |
undefined |
Wrapper classes. Renders a <nav>. |
SidebarItem |
active |
boolean |
false |
Active fill plus aria-current="page". |
SidebarItem |
href |
string |
undefined |
Link target. |
| all parts | class / className |
string |
undefined |
Extra classes, appended last. |