View code
View code
<script setup lang="ts">
import { Sidebar, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider, SidebarTrigger } from '@pharen/ui';
</script>
<template>
<SidebarProvider class="h-80 min-h-0 overflow-hidden rounded-xl border bg-sidebar">
<Sidebar collapsible="none" class="w-56 border-r border-sidebar-border">
<SidebarHeader><span class="px-2 text-sm font-semibold">Pharen</span></SidebarHeader>
<SidebarContent>
<SidebarGroup>
<SidebarGroupLabel>Workspace</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
<SidebarMenuItem v-for="item in ['Overview', 'Workflows', 'Agents']" :key="item">
<SidebarMenuButton :is-active="item === 'Overview'">{{ item }}</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
</Sidebar>
<SidebarInset class="min-w-0">
<header class="flex h-12 items-center gap-2 border-b px-4"><SidebarTrigger /><span class="text-sm font-medium">Overview</span></header>
<main class="grid flex-1 place-items-center p-6 text-sm text-muted-foreground">Workspace content</main>
</SidebarInset>
</SidebarProvider>
</template>
Installation
npm install @pharen/ui
pnpm add @pharen/ui
yarn add @pharen/ui
bun add @pharen/ui
Import
@pharen/ui/styles.css exactly once in your application entrypoint.Usage
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger } from '@pharen/ui';
Exports
| Export | Purpose |
|---|---|
Sidebar | Exported Vue component from this module. |
SidebarContent | Contains the visible content. |
SidebarFooter | Structures the footer region. |
SidebarGroup | Groups related items. |
SidebarGroupAction | Exported Vue component from this module. |
SidebarGroupContent | Contains the visible content. |
SidebarGroupLabel | Labels a value or region. |
SidebarHeader | Structures the header region. |
SidebarInput | Exported Vue component from this module. |
SidebarInset | Exported Vue component from this module. |
SidebarMenu | Exported Vue component from this module. |
SidebarMenuAction | Exported Vue component from this module. |
SidebarMenuBadge | Exported Vue component from this module. |
SidebarMenuButton | Exported Vue component from this module. |
SidebarMenuItem | Represents one item. |
SidebarMenuSkeleton | Exported Vue component from this module. |
SidebarMenuSub | Exported Vue component from this module. |
SidebarMenuSubButton | Exported Vue component from this module. |
SidebarMenuSubItem | Represents one item. |
SidebarProvider | Exported Vue component from this module. |
SidebarRail | Exported Vue component from this module. |
SidebarSeparator | Separates adjacent regions. |
SidebarTrigger | Opens or activates the component. |