# Fruit Design Calm, glassy, rounded React components and CSS, light and dark. MIT licensed. ## Install (React 18+) ```bash npm install @fruit-labs/design ``` ```jsx import '@fruit-labs/design/tokens.css'; import '@fruit-labs/design/styles.css'; import { ThemeProvider, Button } from '@fruit-labs/design'; ``` Or copy the source into your project with the shadcn CLI: ```bash npx shadcn@latest add https://design.fruitlabs.online/r/all.json ``` ## Rules for coding agents - Never hand-roll a button, field, select, table, modal, menu, toast or chat UI that Fruit Design already has. - Never use native select, date, time, range, colour or number inputs. Use Select, DatePicker, TimePicker, Slider, ColorPicker, NumberInput. - Colours, spacing, radii and shadows come only from the CSS variables in tokens.css. No raw hex. - Accent-coloured text uses --accent-ink, never --accent. - One filled (primary) Button per view. Destructive confirms use ConfirmDialog tone="danger". - Status always pairs colour with a word. - Glass (GlassPanel) only for things floating above content. - Icons come from . No emoji as icons. - Every screen must work in light and dark. ## Choosing components Read the app's requirements, list each screen and what the user does on it, then search for a component for each need. Use the library's component whenever one exists. ## Mobile (Flutter, Expo, React Native) No native components. Use the token files: https://design.fruitlabs.online/tokens/fruit_tokens.dart and https://design.fruitlabs.online/tokens/fruit-tokens.ts ## Updates and bugs At the start of UI work, compare the installed version (`npm ls @fruit-labs/design`) with get_changelog or https://design.fruitlabs.online/api/version.json. If it is older, tell the user what changed and update after they agree, then build and check the screens. Copied (shadcn) source is not updated by npm: show the diff before overwriting local changes. If a component has a bug, check the changelog first; otherwise draft an issue for https://github.com/fruit-labs-org/fruit-labs-design/issues and file it only if the user agrees. Do not patch files in node_modules. ## Setup, languages and templates - Quick setup: `npx @fruit-labs/design init` (installs, imports styles, adds agent rules and the MCP server). - Translations and right-to-left: wrap the app in ``. Keys are the built-in English strings. - Page templates: https://design.fruitlabs.online/templates/ (dashboard, ai-chat, sign-in, settings, pricing, onboarding). Theme builder: https://design.fruitlabs.online/themes/ --- # Accordion Expandable sections for FAQs and grouped settings. ## Guidelines - `multiple` allows several open. ## Props ```ts items: Array<{ value?: string; title: React.ReactNode; content: React.ReactNode }>; value?: string[]; defaultValue?: string[]; onChange?: (open: string[]) => void; multiple?: boolean; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { Accordion } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/accordion.json ``` --- # AgentPlan Task plan with progress bar and step timeline that updates as the agent works. ## Guidelines - Update step `status` live; keep step titles as short imperatives. ## Props ```ts title?: React.ReactNode; steps: Array<{ title: React.ReactNode; description?: React.ReactNode; time?: string; status?: 'done' | 'running' | 'pending' | 'error' }>; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { AgentPlan } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/agent-plan.json ``` --- # AgentStatus Status dot + word for an agent or run: idle, thinking, running, waiting, done, error. ## Guidelines - `waiting` = needs human input; surface it prominently. ## Props ```ts status?: 'idle' | 'thinking' | 'running' | 'waiting' | 'done' | 'error'; label?: string; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { AgentStatus } from '@fruit-labs/design'; export default function Demo() { return (
{['idle', 'thinking', 'running', 'waiting', 'done', 'error'].map((s) => ( ))}
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/agent-status.json ``` --- # AppHeader Glass top bar: brand, primary nav, then any right-side children (search, bell, account). ## Guidelines - Sticky with 12px inset by default; `flat` for a full-bleed bar. ## Props ```ts brand?: React.ReactNode; logo?: React.ReactNode; brandHref?: string; links?: Array<{ label: React.ReactNode; href?: string; active?: boolean; onClick?: () => void }>; flat?: boolean; className?: string; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { AppHeader, Avatar, IconButton, SearchField } from '@fruit-labs/design'; export default function Demo() { return (
} links={[ { label: 'Projects', active: true, }, { label: 'Reports', }, { label: 'Team', }, ]} >
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/app-header.json ``` --- # ApprovalCard Human-in-the-loop request: what the agent wants to do, risk level, details, Deny / Always allow / Allow once. ## Guidelines - Say exactly what will happen and where. Show the command or payload in `detail`. - High risk uses a red frame and a red confirm; never auto-approve high risk. ## Props ```ts title?: React.ReactNode; description?: React.ReactNode; detail?: string; risk?: 'low' | 'medium' | 'high'; approveLabel?: string; denyLabel?: string; onApprove?: () => void; onDeny?: () => void; onAlwaysAllow?: () => void; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { ApprovalCard } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/approval-card.json ``` --- # ArtifactPanel Side panel for an agent's output (document, code, preview) with tabs and actions. ## Guidelines - Open beside the chat when the agent produces something to keep. ## Props ```ts title: React.ReactNode; subtitle?: React.ReactNode; icon?: string; tabs?: string[]; tab?: string; onTabChange?: (v: string) => void; actions?: React.ReactNode; className?: string; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { ArtifactPanel, CodeBlock, IconButton } from '@fruit-labs/design'; export default function Demo() { return (
} > \n

Spring launch plan

\n'} />
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/artifact-panel.json ``` --- # AspectRatio Keeps media at a fixed ratio (16:9 default). ## Guidelines - Children (img/video) fill and crop. ## Props ```ts ratio?: number; className?: string; style?: React.CSSProperties; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { AspectRatio } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/aspect-ratio.json ``` --- # AttachmentChip File attached to a prompt or message, with type tag, name, size and remove. ## Guidelines - Show above the prompt while composing, under the user message after sending. ## Props ```ts name: string; size?: string; onRemove?: () => void; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { AttachmentChip } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/attachment-chip.json ``` --- # Autocomplete Combobox: type to filter suggestions (or fetch them with onSearch + loading), match highlighted, keyboard navigation, free text allowed. ## Guidelines - Static lists: pass `options`. Remote data: set `filter={false}`, fetch in `onSearch`, show `loading`. - `onSelect(option)` fires on pick; `onSubmit(text)` on Enter with free text. - Also exported as `Combobox`. ## Props ```ts options?: Array; value?: string; defaultValue?: string; onChange?: (text: string) => void; onSelect?: (option: SelectOption) => void; onSearch?: (q: string) => void; onSubmit?: (text: string) => void; loading?: boolean; filter?: boolean; limit?: number; allowFreeText?: boolean; openOnFocus?: boolean; clearable?: boolean; label?: string; hint?: React.ReactNode; error?: React.ReactNode; required?: boolean; placeholder?: string; icon?: string | null; prefix?: string | React.ReactNode; // inline text/icon name/node before the value, e.g. '$' or 'https://' suffix?: string | React.ReactNode; // inline after the value, e.g. 'kg' or '.com' size?: 'sm' | 'md' | 'lg'; pill?: boolean; emptyText?: string; footer?: React.ReactNode; defaultOpen?: boolean; disabled?: boolean; className?: string; style?: React.CSSProperties; ``` ## Example ```jsx import * as React from 'react'; import { Autocomplete } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/autocomplete.json ``` --- # Avatar Round avatar: image or initials on a fruit color derived from the name. ## Guidelines - Sizes 24 (dense), 32 (tables), 40 (default), 56+ (profiles). ## Props ```ts name?: string; src?: string; size?: number; color?: string; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { Avatar, AvatarGroup } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Sizes ```jsx import { Avatar } from '@fruit-labs/design'; export default function Example() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/avatar.json ``` --- # AvatarGroup Overlapping avatars with a +N overflow. ## Guidelines - Show up to 4; more collapse into +N. ## Props ```ts people: Array; max?: number; size?: number; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { AvatarGroup } from '@fruit-labs/design'; export default function Demo() { return ; } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/avatar-group.json ``` --- # Badge Small status label; tone pairs color with a word. ## Guidelines - Status must be readable without color: always write the status word. - `dot` adds a leading dot for list/table statuses. ## Props ```ts tone?: 'neutral' | 'accent' | 'success' | 'warning' | 'danger'; dot?: boolean; className?: string; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { Badge, CountBadge } from '@fruit-labs/design'; export default function Demo() { return (
New Active Review Blocked Draft
); } ``` ## Order states ```jsx import { Badge } from '@fruit-labs/design'; export default function Example() { return (
Paid Pending Refunded New
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/badge.json ``` --- # Banner Page-level persistent message across the top of a page or section. ## Guidelines - Use for account or system state (payment failed, maintenance). Offer one action. ## Props ```ts tone?: 'info' | 'success' | 'warning' | 'danger'; icon?: string; action?: React.ReactNode; onDismiss?: () => void; className?: string; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { Banner, Link } from '@fruit-labs/design'; export default function Demo() { return (
Update}> Payment failed. {' Update your card to keep your plan.'} {}}>New: dark mode is here.
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/banner.json ``` --- # BarChart Grouped or stacked bars on one axis with hover tooltip, legend (2+ series) and a table view. ## Guidelines - Colors come from --chart-1…5 in fixed order; 6+ series fold into Other. - Bars start at zero; values in tooltip, not on every bar. - `stacked` for part-to-whole over categories. ## Props ```ts width?: number; labels: string[]; series: Array<{ name: string; data: number[]; color?: string }>; stacked?: boolean; height?: number; title?: React.ReactNode; subtitle?: React.ReactNode; format?: (v: number) => string; xLabel?: string; allowTable?: boolean; className?: string; style?: React.CSSProperties; ``` ## Example ```jsx import * as React from 'react'; import { BarChart } from '@fruit-labs/design'; export default function Demo() { return ( ); } ``` ## Stacked ```jsx import { BarChart } from '@fruit-labs/design'; export default function Example() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/bar-chart.json ``` --- # Breadcrumbs Path to the current page; last item is the current page. ## Guidelines - Show from the workspace root; truncate middle items on narrow screens. ## Props ```ts items: Array<{ label: React.ReactNode; href?: string; onClick?: () => void }>; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { Breadcrumbs } from '@fruit-labs/design'; export default function Demo() { return ( ); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/breadcrumbs.json ``` --- # Button Capsule button in five styles and three sizes, with optional icons and a loading state. ## Guidelines - One `filled` button per view: the primary action. `tinted`/`gray` for secondary, `plain` for inline and tertiary. - `destructive` (tinted) in menus and lists; `danger` (filled red) only in the confirm step. - Label with a verb: Save, Invite, Delete project. Sizes: lg 50 (phone/hero), md 36 (default web), sm 28 (toolbars, tables). - Pass `href` to render a link that looks like a button. ## Props ```ts variant?: 'filled' | 'tinted' | 'gray' | 'plain' | 'destructive' | 'danger' | 'glass'; size?: 'sm' | 'md' | 'lg'; icon?: string | React.ReactNode; iconRight?: string | React.ReactNode; loading?: boolean; block?: boolean; href?: string; disabled?: boolean; onClick?: (e: React.MouseEvent) => void; type?: 'button' | 'submit' | 'reset'; className?: string; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { Button } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Sizes and states ```jsx import { Button } from '@fruit-labs/design'; export default function Example() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/button.json ``` --- # ButtonGroup Groups related buttons; `attached` joins them into one capsule. ## Guidelines - Attached groups: same variant for every button. ## Props ```ts attached?: boolean; label?: string; className?: string; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { Button, ButtonGroup, Stack } from '@fruit-labs/design'; export default function Demo() { return ( ); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/button-group.json ``` --- # Calendar Inline month calendar (single or range). ## Guidelines - Use inline in booking flows; otherwise use DatePicker. ## Props ```ts mode?: 'single' | 'range'; value?: any; defaultValue?: any; onChange?: (value: any) => void; min?: Date; max?: Date; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { Calendar } from '@fruit-labs/design'; export default function Demo() { return ( ); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/calendar.json ``` --- # Callout Inline tinted message in the page flow: info, success, warning, danger. ## Guidelines - Short title + one sentence. Danger callouts are announced (role=alert). ## Props ```ts tone?: 'info' | 'success' | 'warning' | 'danger'; title?: React.ReactNode; icon?: string; className?: string; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { Callout } from '@fruit-labs/design'; export default function Demo() { return (
Sync resumes when you’re back on Wi-Fi. Your changes are saved. Free up space to keep backing up. Check your connection and try again.
); } ``` ## Tones ```jsx import { Callout } from '@fruit-labs/design'; export default function Example() { return (
Mail will now be delivered. Update your card to keep access.
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/callout.json ``` --- # Card Content container on surface with optional title, subtitle and header actions. ## Guidelines - Radius 22, padding 24. Inner elements use radius 14 (concentric). - `flat` removes the shadow; `inset` sits on surface-2 inside another card. ## Props ```ts title?: React.ReactNode; subtitle?: React.ReactNode; actions?: React.ReactNode; variant?: 'default' | 'flat' | 'inset'; as?: keyof React.JSX.IntrinsicElements; className?: string; style?: React.CSSProperties; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { Button, Card, Progress } from '@fruit-labs/design'; export default function Demo() { return ( Manage } style={{ maxWidth: 420, }} > ); } ``` ## With actions ```jsx import { Button, Card } from '@fruit-labs/design'; export default function Example() { return (
Upgrade}> Renews on 1 June.
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/card.json ``` --- # Carousel Slides with prev/next glass buttons and dots; keyboard and screen-reader labelled. ## Guidelines - Never auto-advance without a pause control. ## Props ```ts index?: number; defaultIndex?: number; onIndexChange?: (i: number) => void; loop?: boolean; label?: string; className?: string; style?: React.CSSProperties; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { Carousel } from '@fruit-labs/design'; export default function Demo() { return (
{['var(--tile-grape)', 'var(--tile-tangerine)', 'var(--tile-kiwi)'].map((c, i) => (
{'Slide ' + (i + 1)}
))}
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/carousel.json ``` --- # ChatMessage One chat turn: user bubble on the right, assistant text on the left with avatar, attachments and actions. ## Guidelines - Assistant replies are unboxed text for readability; user messages sit in a fill bubble. - Set `streaming` while tokens arrive (blinking caret). Put MessageActions under finished replies. ## Props ```ts role?: 'user' | 'assistant' | 'system'; name?: string; avatar?: React.ReactNode; streaming?: boolean; attachments?: React.ReactNode; actions?: React.ReactNode; className?: string; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { AttachmentChip, ChatMessage, Citation, MessageActions } from '@fruit-labs/design'; export default function Demo() { return (
}> Summarize the attached report in three bullets. } >

Here are the key points :

Revenue grew in every region, led by APAC.

Drafting the follow-up email
); } ``` ## Streaming reply ```jsx import { ChatMessage } from '@fruit-labs/design'; export default function Example() { return (
Reading your invoices
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/chat-message.json ``` --- # Checkbox Checkbox with checked, unchecked and indeterminate states, plus required, hint and visible error. ## Guidelines - Use in forms, lists and table selection. Indeterminate = some children selected. - Consent boxes: `required` + `error`. With useForm: `I accept the terms`; the error appears under the box on submit and when it's unticked again. ## Props ```ts checked?: boolean; defaultChecked?: boolean; indeterminate?: boolean; onChange?: (checked: boolean) => void; onBlur?: () => void; hint?: React.ReactNode; error?: React.ReactNode; required?: boolean; disabled?: boolean; name?: string; label?: string; className?: string; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { Checkbox } from '@fruit-labs/design'; export default function Demo() { return (
Sync photos Select all Send me the newsletter I accept the terms
); } ``` ## A group ```jsx import { Checkbox } from '@fruit-labs/design'; export default function Example() { return (
Product news Weekly digest Security alerts (always on)
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/checkbox.json ``` --- # Chip Filter chip: toggles a filter on or off, or shows a removable applied filter. ## Guidelines - `selected` shows a check and inverts. `variant="dashed"` for an 'add filter' affordance. `onRemove` adds an ×. ## Props ```ts selected?: boolean; icon?: string; variant?: 'default' | 'dashed'; onRemove?: () => void; onClick?: (e: React.MouseEvent) => void; className?: string; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { Chip } from '@fruit-labs/design'; export default function Demo() { return (
All Music Podcasts Status
); } ``` ## Filters ```jsx import { Chip } from '@fruit-labs/design'; export default function Example() { return (
Open Closed Add filter
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/chip.json ``` --- # Citation Inline numbered citation marker linking to a source. ## Guidelines - Place after the sentence it supports. ## Props ```ts n: number; href?: string; ``` ## Example ```jsx import * as React from 'react'; import { Citation } from '@fruit-labs/design'; export default function Demo() { return (

Revenue grew 12% year over year .

); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/citation.json ``` --- # CodeBlock Monospace code panel with title and copy button. ## Guidelines - Use for snippets, commands and JSON. No syntax colors by default; bring your own highlighter if needed. ## Props ```ts code: string; language?: string; title?: string; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { CodeBlock } from '@fruit-labs/design'; export default function Demo() { return ( ); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/code-block.json ``` --- # Collapsible Single show/hide section. ## Guidelines - For many sections use Accordion. ## Props ```ts title: React.ReactNode; open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean) => void; className?: string; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { Collapsible } from '@fruit-labs/design'; export default function Demo() { return (
Webhooks, API keys and data retention.
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/collapsible.json ``` --- # ColorPicker Swatch grid plus hex field. ## Guidelines - Pass your brand colors as `swatches`. ## Props ```ts value?: string; defaultValue?: string; onChange?: (hex: string) => void; swatches?: string[]; label?: string; hint?: React.ReactNode; className?: string; style?: React.CSSProperties; ``` ## Example ```jsx import * as React from 'react'; import { ColorPicker } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/color-picker.json ``` --- # CommandPalette ⌘K command menu: search, grouped results, keyboard first. ## Guidelines - Open with `useHotkey('k', ...)`. Group by Suggestions, then entities. ## Props ```ts open: boolean; onClose?: () => void; groups: Array<{ label: string; items: Array<{ label: string; icon?: string; shortcut?: string; onSelect?: () => void }> }>; placeholder?: string; label?: string; contained?: boolean; ``` ## Example ```jsx import * as React from 'react'; import { CommandPalette } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/command-palette.json ``` --- # ConfirmDialog Alert dialog that confirms an action; `tone="danger"` for destructive ones. ## Guidelines - Name the object and the consequence: "Delete ‘Billing migration’? 14 files will be removed." - Cancel first, confirm second; the confirm label repeats the verb. ## Props ```ts open: boolean; title: React.ReactNode; description?: React.ReactNode; tone?: 'default' | 'danger'; icon?: string; confirmLabel?: string; cancelLabel?: string; loading?: boolean; onConfirm?: () => void; onCancel?: () => void; contained?: boolean; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { ConfirmDialog } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/confirm-dialog.json ``` --- # Container Centered page container with max width and responsive side padding. ## Guidelines - Default 1200px; use 720 for reading pages and forms. ## Props ```ts width?: number | string; as?: keyof React.JSX.IntrinsicElements; className?: string; style?: React.CSSProperties; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { Container } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/container.json ``` --- # ContextMenu Right-click menu on any area; same items API as Menu. ## Guidelines - Always offer the same actions elsewhere (toolbar or row menu): right-click is invisible. ## Props ```ts items: MenuProps['items']; label?: string; defaultOpen?: boolean; defaultPosition?: { x: number; y: number }; className?: string; style?: React.CSSProperties; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { ContextMenu } from '@fruit-labs/design'; export default function Demo() { return (
Right-click here
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/context-menu.json ``` --- # ConversationList Sidebar list of chats or agent runs, grouped by date, with live status. ## Guidelines - Groups: Today, Yesterday, Previous 7 days. Titles are auto-summaries. ## Props ```ts groups: Array<{ label: string; items: Array<{ title: string; href?: string; active?: boolean; status?: string; onClick?: () => void }> }>; label?: string; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { ConversationList } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/conversation-list.json ``` --- # CopyButton Icon button that copies text to the clipboard and confirms with a check. ## Guidelines - Use next to code, IDs, links and API keys (masked). ## Props ```ts text: string; label?: string; variant?: 'plain' | 'gray' | 'tinted'; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { CopyButton } from '@fruit-labs/design'; export default function Demo() { return (
proj_8f2c91
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/copy-button.json ``` --- # CountBadge Red numeric badge for unread counts. ## Guidelines - Caps at `max` (99+). Give it a `label` like "3 unread". ## Props ```ts count: number; max?: number; label?: string; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { CountBadge } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/count-badge.json ``` --- # CurrencyInput Money amount with the currency symbol, locale grouping (12,00,000 in en-IN), and an attached currency code. ## Guidelines - Value is a number (or null). Shows raw digits while editing, formatted on blur. - Use for salary/CTC, prices and budgets; set `currency` and `locale`. ## Props ```ts value?: number | null; defaultValue?: number | null; onChange?: (value: number | string | null) => void; currency?: string; locale?: string; decimals?: number; showCode?: boolean; label?: string; hint?: React.ReactNode; error?: React.ReactNode; required?: boolean; placeholder?: string; size?: 'sm' | 'md' | 'lg'; className?: string; style?: React.CSSProperties; ``` ## Example ```jsx import * as React from 'react'; import { CurrencyInput } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/currency-input.json ``` --- # DatePicker Date or date-range field that opens a calendar popover. ## Guidelines - `mode="range"` picks start then end. Weeks start Monday; output uses the user's locale. ## Props ```ts style?: React.CSSProperties; mode?: 'single' | 'range'; value?: Date | { start: Date; end: Date | null } | null; defaultValue?: Date | { start: Date; end: Date | null } | null; onChange?: (value: any) => void; label?: string; placeholder?: string; min?: Date; max?: Date; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { DatePicker } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/date-picker.json ``` --- # DiffView Unified diff of a proposed code change with +/− counts. ## Guidelines - Pair with an ApprovalCard before applying edits. ## Props ```ts lines: string[]; // each starts with '+', '-' or ' ' filename?: string; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { DiffView } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/diff-view.json ``` --- # Divider 1px hairline separator. ## Guidelines - Prefer spacing over dividers; use between unrelated groups. ## Props ```ts className?: string; style?: React.CSSProperties; ``` ## Example ```jsx import * as React from 'react'; import { Divider } from '@fruit-labs/design'; export default function Demo() { return ; } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/divider.json ``` --- # DonutChart Part-to-whole for ≤5 slices with center total, hover detail and % legend. ## Guidelines - More than 5 parts: use a bar chart. ## Props ```ts valueLabel?: React.ReactNode; data: Array<{ label: string; value: number; color?: string }>; size?: number; thickness?: number; centerValue?: React.ReactNode; centerLabel?: string; title?: React.ReactNode; format?: (v: number) => string; allowTable?: boolean; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { DonutChart } from '@fruit-labs/design'; export default function Demo() { return (
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/donut-chart.json ``` --- # Drawer Side sheet for details and edits without leaving the page; bottom sheet on phones. ## Guidelines - 400px default (`width` to change). Header title + close; footer actions fill the width. ## Props ```ts open: boolean; onClose?: () => void; title: React.ReactNode; footer?: React.ReactNode; width?: number | string; contained?: boolean; className?: string; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { Badge, Button, Drawer, List, ListRow } from '@fruit-labs/design'; export default function Demo() { return (
} > Review } />
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/drawer.json ``` --- # EmptyState What's missing and one action to fix it. ## Guidelines - Title says what's empty; description says why it matters; one primary action. ## Props ```ts title: React.ReactNode; description?: React.ReactNode; icon?: string; action?: React.ReactNode; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { Button, EmptyState } from '@fruit-labs/design'; export default function Demo() { return (
New project} />
); } ``` ## With action ```jsx import { Button, EmptyState } from '@fruit-labs/design'; export default function Example() { return (
Clear filters} />
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/empty-state.json ``` --- # Field Label + control + hint/error wrapper; adds a required asterisk or an (optional) marker. ## Guidelines - Children may be a function receiving the generated id for `htmlFor`. - Mark the minority: if most fields are required, mark the optional ones with `optional`; otherwise mark `required`. ## Props ```ts label?: React.ReactNode; hint?: React.ReactNode; error?: React.ReactNode; required?: boolean; optional?: boolean; id?: string; className?: string; style?: React.CSSProperties; children: React.ReactNode | ((id: string) => React.ReactNode); ``` ## Example ```jsx import * as React from 'react'; import { Field, NumberInput } from '@fruit-labs/design'; export default function Demo() { return (
{(id) => }
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/field.json ``` --- # FileItem One uploaded or uploading file with type tag, progress or size, and remove. ## Guidelines - Use under FileUpload or in attachments lists. ## Props ```ts name: string; size?: string; progress?: number; onRemove?: () => void; className?: string; ``` ## Example ```jsx import * as React from 'react'; import { FileItem } from '@fruit-labs/design'; export default function Demo() { return (
{}} />
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/file-item.json ``` --- # FileUpload Click-or-drop zone with a visible label, custom title, hint, sizes and error; pair with FileItem rows. ## Guidelines - `label` is the visible field label (and names the zone for screen readers); `title` replaces the 'Choose a file or drag it here' text; `ariaLabel` only when there's no visible label. - State accepted types and size in `hint`. `size="sm"` is a one-line zone for dense forms. ## Props ```ts onFiles?: (files: File[]) => void; accept?: string; multiple?: boolean; label?: React.ReactNode; title?: React.ReactNode; hint?: string; error?: React.ReactNode; required?: boolean; size?: 'sm' | 'md'; disabled?: boolean; ariaLabel?: string; className?: string; style?: React.CSSProperties; ``` ## Example ```jsx import * as React from 'react'; import { FileUpload } from '@fruit-labs/design'; export default function Demo() { return (
Upload logo {' · SVG or PNG'} } error="Add a logo to continue." />
); } ``` ## Install ```bash npx shadcn@latest add https://design.fruitlabs.online/r/file-upload.json ``` --- # Form Form recipe: grid layout, sections, required fields, inline validation on blur, error summary, submit with loading. Includes useForm(), FormRow and FormSection. ## Guidelines - `useForm({ initialValues, rules, onSubmit })` returns `field(name)` bindings (value, onChange, onBlur, error, required), `handleSubmit`, `submitting`, `submitted`, `errors`. - Rules per field: `required` (true or message), `minLength`, `pattern` + `patternMessage`, `validate(value, values)` → message. - Errors appear after a field is blurred or on submit; submit focuses the first invalid field. A rejected `onSubmit` shows `errors._form` (pass it to `
`). - Layout: ``; `` for wide fields; `` groups related fields. Collapses to one column under 640px. - Actions: Cancel (gray) then Submit (filled, `type="submit"`, `loading={submitting}`). ## Props ```ts columns?: number; gap?: number; title?: React.ReactNode; description?: React.ReactNode; error?: React.ReactNode; actions?: React.ReactNode; onSubmit?: (e: React.FormEvent) => void; className?: string; children?: React.ReactNode; ``` ## Example ```jsx import * as React from 'react'; import { Badge, Button, Card, Checkbox, Form, FormRow, Select, TextField, Textarea, useForm, } from '@fruit-labs/design'; export default function Demo() { const f = useForm({ initialValues: { first: 'Ada', last: '', email: '', role: '', bio: '', terms: false, }, rules: { first: { required: 'Enter your first name.', }, last: { required: 'Enter your last name.', }, email: { required: 'Enter your email.', pattern: /^[^@\s]+@[^@\s]+\.[^@\s]+$/, patternMessage: 'Enter a full email address, like name@company.com.', }, role: { required: 'Choose a role.', }, terms: { required: 'Accept the terms to continue.', }, }, onSubmit: (v) => new Promise((r) => setTimeout(r, 800)), }); return ( {f.submitted && ( Saved )} } >