Components
Sidebar
A vertical navigation panel with headers, groups and footer slots.
Installation
$ npx veil-ui@latest add sidebarUsage
import {
Sidebar,
SidebarContent,
SidebarGroup,
SidebarGroupLabel,
SidebarHeader,
SidebarItem,
} from "@/components/ui/sidebar";
<Sidebar>
<SidebarHeader>Acme</SidebarHeader>
<SidebarContent>
<SidebarGroup>
<SidebarGroupLabel>Workspace</SidebarGroupLabel>
<SidebarItem href="/" active>
Dashboard
</SidebarItem>
<SidebarItem href="/settings">Settings</SidebarItem>
</SidebarGroup>
</SidebarContent>
</Sidebar>;Examples
Basic
Groups
API reference
Subcomponents
Sidebar— bordered column container.SidebarHeader,SidebarContent,SidebarFooter— vertical regions.SidebarGroup,SidebarGroupLabel— labelled link clusters.SidebarItem— anchor with anactivestate.
Accessibility
SidebarItemexposesaria-current="page"whenactive.- Group labels are plain text; pair the sidebar with a surrounding
<nav aria-label="…">when it is the primary navigation. - Rendered links are real anchors, so keyboard and middle-click work.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add sidebar --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { cn } from "@/lib/utils";
const props = defineProps<{ class?: string }>();
</script>
<template>
<aside
data-slot="sidebar"
:class="cn('flex h-full w-64 flex-col border-r bg-background', props.class)"
>
<slot />
</aside>
</template>