Sidebar
App navigation column with sections, counts and colored team dots.
Code
import * as React from 'react';
import { Sidebar } from '@fruit-labs/design';
export default function Demo() {
return (
<Sidebar
header="Orchard"
sections={[
{
items: [
{
label: 'Home',
icon: 'home',
active: true,
},
{
label: 'Projects',
icon: 'grid',
count: 28,
},
{
label: 'Reports',
icon: 'chart',
},
{
label: 'Inbox',
icon: 'bell',
count: 3,
},
],
},
{
title: 'Teams',
items: [
{
label: 'Design',
color: 'var(--fruit-grape)',
},
{
label: 'Engineering',
color: 'var(--fruit-kiwi)',
},
],
},
]}
/>
);
}Install
From npm:
npm install @fruit-labs/design
import { Sidebar } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/sidebar.jsonGuidelines
- 240–280 wide. Collapse to icons or a drawer below 960px.
Props
| Prop | Type | Required |
|---|---|---|
header | React.ReactNode | No |
items | SidebarItem[] | No |
sections | Array<{ title?: string; items: SidebarItem[] }> | No |
glass | boolean | No |
label | string | No |
className | string | No |
style | React.CSSProperties | No |
children | React.ReactNode | No |