# BIU UI — Full Documentation & API Reference Index: https://ui.biu.dev/llms.txt > Zero-Tailwind React 19 UI library built on Base UI 1.9 and 4-layer `@layer` CSS. All API references and usage examples below are public. Component TSX source is open source (MIT) for Free items and gated for BIU UI Pro items. ## Installation Summary - Open Source (41 components + 2 starter blocks): - npm: `pnpm add @biudev/ui @base-ui/react` - shadcn Registry: `pnpm dlx shadcn add @biudev/` (registry URL: `https://ui.biu.dev/r/0.1.0/{name}.json`) - CLI: `npx @biudev/cli add --registry https://ui.biu.dev/r/0.1.0` - BIU UI Pro (11 advanced components + 11 workspace blocks): - Interactive previews & API references are public; private `@biudev-pro/*` registry source requires a BIU UI Pro license. ## Design System Foundations - **Overview** (https://ui.biu.dev/docs/design-system): Default design philosophy, 4-layer CSS architecture, and foundation index. - **Colors** (https://ui.biu.dev/docs/design-system/colors): Surfaces, alpha ink hierarchy, achromatic actions, and 6 semantic status tones. - **Typography** (https://ui.biu.dev/docs/design-system/typography): Heading (Nunito), UI Sans (Inter), and Monospace stacks, 7-step type ramp, and tabular numerals. - **Spacing & density** (https://ui.biu.dev/docs/design-system/spacing): 4px base spacing scale (including 6px compact & 20px dialog steps), aligned 28/32/36px control heights, and touch targets. - **Radius & geometry** (https://ui.biu.dev/docs/design-system/radius): 5-step corner ladder and the concentric nesting formula for containers. - **Elevation & shadows** (https://ui.biu.dev/docs/design-system/shadows): 0.5px hairline rings paired with soft multi-layer shadows for Light and Dark. - **Motion** (https://ui.biu.dev/docs/design-system/motion): Decision framework, live curve comparison, timing table, 5 interactive recipes, and reduced motion. - **Focus & accessibility** (https://ui.biu.dev/docs/design-system/focus): Keyboard-only :focus-visible rings, roving tabindex, and dialog focus restoration. - **Layers & theming** (https://ui.biu.dev/docs/design-system/layers): Z-index stacking tiers, React 19 style precedence, and custom theme composition. --- ## Chat Composer - **URL**: https://ui.biu.dev/docs/components/chat-composer - **Category**: AI Agents - **Edition**: Open Source (MIT) - **Summary**: Auto-growing AI prompt input with file attachments, drag-and-drop, model & approval pickers, voice dictation, and streaming stop controls. - **Install (shadcn)**: `pnpm dlx shadcn add @biudev/chat-composer` - **Install (npm)**: `import { ChatComposer } from "@biudev/ui/chat-composer"` - **Public Source**: https://ui.biu.dev/docs/source/chat-composer ### Usage ```tsx import { ChatComposer } from "@/components/ui/biu/chat-composer"; export function Example() { return ( console.log("send", payload)} /> ); } ``` ### API Reference #### ChatComposerStatus Inherits: `'ready' & 'submitted' & 'streaming'` `'ready' | 'submitted' | 'streaming'` #### ChatComposerModel | Prop | Type | Default | Description | | --- | --- | --- | --- | | `id` (required) | `string` | `—` | Unique identifier for this element or item. | | `name` (required) | `string` | `—` | Form field name or display name. | | `description` | `string` | `—` | Secondary supporting description text. | | `badge` | `string` | `—` | Optional badge value or count displayed beside the label. | | `icon` | `ReactNode` | `—` | Leading icon element. | #### ChatComposerApprovalMode | Prop | Type | Default | Description | | --- | --- | --- | --- | | `id` (required) | `string` | `—` | Unique identifier for this element or item. | | `label` (required) | `string` | `—` | Visible text label or accessible name. | | `description` | `string` | `—` | Secondary supporting description text. | | `tone` | `'neutral' \| 'info' \| 'warning' \| 'danger'` | `—` | Semantic color tone (neutral, info, success, warning, danger, or purple). | #### ChatComposerAttachment | Prop | Type | Default | Description | | --- | --- | --- | --- | | `id` (required) | `string` | `—` | Unique identifier for this element or item. | | `name` (required) | `string` | `—` | Form field name or display name. | | `size` | `number` | `—` | Size tier controlling height, padding, and typography. | | `mimeType` | `string` | `—` | MIME type of the attached file. | | `previewUrl` | `string` | `—` | Caller-owned preview URL. The composer generates its own temporary previews for image files without one. | | `file` | `File` | `—` | Underlying browser File object when attached from disk. | #### ChatComposerSuggestion | Prop | Type | Default | Description | | --- | --- | --- | --- | | `id` (required) | `string` | `—` | Unique identifier for this element or item. | | `label` (required) | `string` | `—` | Visible text label or accessible name. | | `prompt` (required) | `string` | `—` | Submitted prompt text. | | `icon` | `ReactNode` | `—` | Leading icon element. | #### ChatComposerCommand | Prop | Type | Default | Description | | --- | --- | --- | --- | | `value` (required) | `string` | `—` | Command slug without the leading slash (e.g. `'review'`, `'fix'`). | | `label` (required) | `string` | `—` | Human-readable command title shown in the slash menu. | | `description` | `string` | `—` | Optional short explanation shown beside or beneath the label. | | `icon` | `ReactNode` | `—` | Optional leading icon. | | `shortcut` | `string` | `—` | Optional trailing keyboard hint or badge. | #### ChatComposerAction | Prop | Type | Default | Description | | --- | --- | --- | --- | | `value` (required) | `string` | `—` | Action identifier passed to `onAction`. | | `label` (required) | `string` | `—` | Action label rendered inside the `+` menu. | | `description` | `string` | `—` | Optional supporting description. | | `icon` | `ReactNode` | `—` | Optional leading icon. | #### ChatComposerSubmitPayload | Prop | Type | Default | Description | | --- | --- | --- | --- | | `text` (required) | `string` | `—` | Plain text content for the item or status. | | `attachments` (required) | `ChatComposerAttachment[]` | `—` | Attached files included with the prompt. | | `modelId` | `string` | `—` | Selected model identifier. | | `approvalModeId` | `string` | `—` | Selected agent approval policy identifier. | #### ChatComposerLabels | Prop | Type | Default | Description | | --- | --- | --- | --- | | `placeholder` (required) | `string` | `—` | Placeholder text displayed when the input is empty. | | `send` (required) | `string` | `—` | Accessible label for the send prompt button. | | `stop` (required) | `string` | `—` | Accessible label for stopping an active generation. | | `submitting` (required) | `string` | `—` | Indicates an asynchronous submission is in progress. | | `attach` (required) | `string` | `—` | Accessible label for the attach-files button. | | `removeAttachment` (required) | `(name: string) => string` | `—` | Accessible label for removing an attachment chip. | | `selectModel` (required) | `string` | `—` | Accessible label for the model selector menu. | | `selectApproval` (required) | `string` | `—` | Accessible label for the approval mode selector menu. | | `voiceStart` (required) | `string` | `—` | Accessible label for starting voice dictation. | | `voiceStop` (required) | `string` | `—` | Accessible label for stopping voice dictation. | | `dropHint` (required) | `string` | `—` | Prompt shown when dragging files over the composer. | | `voiceUnavailable` | `string` | `—` | Notice shown when browser speech recognition is unavailable. | | `dictationSample` (required) | `string` | `—` | Fallback demo phrase inserted when voice API is unavailable. | #### ChatComposerProps | Prop | Type | Default | Description | | --- | --- | --- | --- | | `value` | `string` | `—` | Controlled text value. | | `defaultValue` | `string` | `''` | Uncontrolled initial text value. | | `onValueChange` | `(value: string) => void` | `—` | Fired whenever the prompt text changes. | | `onSubmit` | `(payload: ChatComposerSubmitPayload) => void` | `—` | Fired when the user submits via Enter or the send button. | | `onStop` | `() => void` | `—` | Fired when the user clicks Stop during `'streaming'` status. | | `status` | `ChatComposerStatus` | `'ready'` | Current submission / streaming lifecycle state. Defaults to `'ready'`. | | `placeholder` | `string` | `—` | Placeholder copy inside the auto-growing textarea. | | `disabled` | `boolean` | `false` | Disables typing, attachments, and submission. | | `autoFocus` | `boolean` | `false` | Auto-focus the textarea on mount. | | `maxHeight` | `number` | `200` | Maximum textarea height in pixels before scrolling. Defaults to `200`. | | `models` | `readonly ChatComposerModel[]` | `DEFAULT_CHAT_MODELS` | Available models shown in the bottom-left model picker. Pass `[]` to hide. | | `model` | `string` | `—` | Controlled selected model id. | | `defaultModel` | `string` | `—` | Uncontrolled initial model id. | | `onModelChange` | `(modelId: string) => void` | `—` | Fired when the user selects a different model. | | `approvalModes` | `readonly ChatComposerApprovalMode[]` | `—` | Optional human-in-the-loop approval modes (e.g. Always ask / Approve edits / Full access). | | `approvalMode` | `string` | `—` | Controlled selected approval mode id. | | `defaultApprovalMode` | `string` | `—` | Uncontrolled initial approval mode id. | | `onApprovalModeChange` | `(modeId: string) => void` | `—` | Fired when the user switches approval mode. | | `attachments` | `readonly ChatComposerAttachment[]` | `—` | Controlled attachment list. | | `defaultAttachments` | `readonly ChatComposerAttachment[]` | `[]` | Uncontrolled initial attachments. | | `onAttachmentsChange` | `(attachments: ChatComposerAttachment[]) => void` | `—` | Fired whenever attachments are added or removed. | | `allowAttachments` | `boolean` | `true` | Enables file attach button, paste, and drag-and-drop. Defaults to `true`. | | `accept` | `string` | `—` | Accepted MIME types / extensions for the file picker, paste, and drop. | | `maxAttachments` | `number` | `8` | Maximum number of attached files. Defaults to `8`. | | `voice` | `boolean` | `true` | Shows the voice dictation trigger with animated waveform feedback. Defaults to `true`. | | `onVoiceChange` | `(listening: boolean) => void` | `—` | Optional custom handler when toggling voice input; if omitted, uses Web Speech API with graceful fallback. | | `suggestions` | `readonly ChatComposerSuggestion[]` | `—` | Optional starter prompt chips displayed beneath the composer card. | | `submitOnSuggestion` | `boolean` | `false` | If `true`, clicking a suggestion submits immediately instead of filling the textarea. Defaults to `false`. | | `commands` | `readonly ChatComposerCommand[]` | `—` | Optional `/` slash commands surfaced in a floating menu when typing `/` in the prompt. | | `onCommand` | `(command: ChatComposerCommand) => void` | `—` | Fired when the user selects a `/` slash command. | | `actions` | `readonly ChatComposerAction[]` | `—` | Optional quick actions rendered in a `+` dropdown menu alongside file upload. | | `onAction` | `(actionValue: string) => void` | `—` | Fired when the user picks an item from the `+` quick actions menu. | | `header` | `ReactNode` | `—` | Optional banner or context slot rendered at the top of the composer card (e.g. reply quote or approval notice). | | `leadingActions` | `ReactNode` | `—` | Optional custom controls rendered on the left side of the bottom toolbar after built-in pickers. | | `trailingActions` | `ReactNode` | `—` | Optional custom controls rendered on the right side of the bottom toolbar before voice/send. | | `footerHint` | `ReactNode` | `—` | Optional hint text rendered beneath the composer (e.g. keyboard shortcut or disclaimer). | | `labels` | `Partial` | `—` | Localized labels and aria strings. | | `className` | `string` | `—` | Additional CSS class name applied to the root element. | | `style` | `CSSProperties` | `—` | Inline CSS styles applied to the root element. | --- ## AI Message - **URL**: https://ui.biu.dev/docs/components/ai-message - **Category**: AI Agents - **Edition**: Open Source (MIT) - **Summary**: User & assistant turns with streaming cursor, hoverable inline citations, collapsible Sources drawer, version branches, copy, retry, and feedback reasons. - **Install (shadcn)**: `pnpm dlx shadcn add @biudev/ai-message` - **Install (npm)**: `import { AIMessage } from "@biudev/ui/ai-message"` - **Public Source**: https://ui.biu.dev/docs/source/ai-message ### Usage ```tsx import { AiMessage } from "@/components/ui/biu/ai-message"; export function Example() { return ( {}} /> ); } ``` ### API Reference #### AiMessageRole Inherits: `'user' & 'assistant' & 'system'` `'user' | 'assistant' | 'system'` #### AiFeedbackValue Inherits: `'up' & 'down' & null` `'up' | 'down' | null` #### AiCitation | Prop | Type | Default | Description | | --- | --- | --- | --- | | `id` (required) | `string \| number` | `—` | 1-based index or stable key referenced as `[id]` inside `content` (e.g. `1`, `2`, or `"doc-1"`). | | `title` (required) | `string` | `—` | Primary heading or title text. | | `url` (required) | `string` | `—` | Destination URL for the link or citation. | | `domain` | `string` | `—` | Hostname or domain label associated with a source. | | `excerpt` | `string` | `—` | Short excerpt or snippet shown in previews and citation cards. | | `monogram` | `string` | `—` | Single-character badge monogram for a source or brand. | #### AiMessageBranch | Prop | Type | Default | Description | | --- | --- | --- | --- | | `current` (required) | `number` | `—` | Marks the breadcrumb item as the current page, or current 1-based branch index. | | `total` (required) | `number` | `—` | Total number of items across all pages or branches. | | `onChange` (required) | `(nextIndex: number) => void` | `—` | Callback invoked when the value changes. | #### AiMessageLabels | Prop | Type | Default | Description | | --- | --- | --- | --- | | `copy` (required) | `string` | `—` | Label for the copy action button. | | `copied` (required) | `string` | `—` | Label shown after content is copied. | | `copyFailed` | `string` | `—` | Notice shown when clipboard access fails. | | `retry` (required) | `string` | `—` | Label for retrying an assistant response. | | `helpful` (required) | `string` | `—` | Accessible label for positive feedback. | | `unhelpful` (required) | `string` | `—` | Accessible label for negative feedback. | | `previousBranch` (required) | `string` | `—` | Accessible label for navigating to the previous response branch. | | `nextBranch` (required) | `string` | `—` | Accessible label for navigating to the next response branch. | | `usedSources` (required) | `(count: number) => string` | `—` | Formatter for the inline sources summary label. | | `feedbackPrompt` (required) | `string` | `—` | Heading shown inside the negative feedback popover. | | `feedbackThanks` (required) | `string` | `—` | Confirmation message shown after submitting feedback. | | `feedbackReasons` (required) | `readonly string[]` | `—` | Quick-select reasons offered when reporting an issue. | | `openSource` (required) | `string` | `—` | Label for opening a citation link. | #### InlineCitationProps | Prop | Type | Default | Description | | --- | --- | --- | --- | | `citation` (required) | `AiCitation` | `—` | Citation metadata displayed in the card or chip. | | `variant` | `'number' \| 'domain'` | `'number'` | Display style: `'number'` shows `[1]` badge; `'domain'` shows compact hostname chip. Defaults to `'number'`. | | `highlighted` | `boolean` | `false` | Highlighted state synced when hovering a source card. | | `onHoverChange` | `(hovering: boolean) => void` | `—` | Callback invoked when the hovered state changes. | | `onSelect` | `(citation: AiCitation) => void` | `—` | Callback invoked when the item is selected. | | `openSourceLabel` | `string` | `DEFAULT_LABELS.openSource` | Accessible label for opening the cited source URL. | #### MessageSourcesProps | Prop | Type | Default | Description | | --- | --- | --- | --- | | `citations` (required) | `readonly AiCitation[]` | `—` | List of source citations referenced by the message. | | `open` | `boolean` | `—` | Controlled expanded state. | | `defaultOpen` | `boolean` | `false` | Uncontrolled initial expanded state. Defaults to `false`. | | `onOpenChange` | `(open: boolean) => void` | `—` | Callback invoked when the open state toggles. | | `highlightedId` | `string \| number \| null` | `—` | Currently highlighted citation id (e.g. hovered inline chip). | | `onHoverCitation` | `(id: string \| number \| null) => void` | `—` | Callback invoked when hovering a citation chip. | | `onSelectCitation` | `(citation: AiCitation) => void` | `—` | Callback invoked when clicking a citation chip. | | `label` | `(count: number) => string` | `DEFAULT_LABELS.usedSources` | Visible text label or accessible name. | #### AiMessageProps | Prop | Type | Default | Description | | --- | --- | --- | --- | | `role` | `AiMessageRole` | `'assistant'` | Speaker role controlling bubble vs editorial layout. Defaults to `'assistant'`. | | `author` | `string` | `—` | Optional display author name (e.g. `'Claude Sonnet 4'` or `'You'`). | | `meta` | `string` | `—` | Optional model or role metadata shown beside the author. | | `timestamp` | `string` | `—` | Optional formatted timestamp (e.g. `'10:42 AM'`). | | `avatar` | `ReactNode \| boolean` | `—` | Show an avatar beside assistant turns (or custom `ReactNode` / `false` to hide). Defaults to `true` for assistant turns. | | `content` | `string` | `—` | Plain text body supporting automatic `[1]`, `[2]` inline citation tokens when `citations` are provided. | | `children` | `ReactNode` | `—` | Rich custom body content (rendered instead of `content` when provided). | | `beforeContent` | `ReactNode` | `—` | Optional content rendered above the answer body (e.g. Thinking state or Tool call cards). | | `attachments` | `readonly { id: string; name: string; meta?: string }[]` | `—` | Optional attachments list displayed on user messages. | | `citations` | `readonly AiCitation[]` | `—` | Source citations rendered as hoverable inline chips and a collapsible Sources drawer. | | `citationVariant` | `'number' \| 'domain'` | `'number'` | Display style for auto-parsed inline citations. Defaults to `'number'`. | | `defaultSourcesOpen` | `boolean` | `false` | Controlled or initial Sources drawer expansion. Defaults to `false`. | | `onCitationClick` | `(citation: AiCitation) => void` | `—` | Fired when a citation chip or source card is clicked. | | `streaming` | `boolean` | `false` | Shows animated streaming cursor and agent working ring while response is generating. | | `copyText` | `string` | `—` | Text copied by the Copy action; defaults to `content`. | | `copyable` | `boolean` | `—` | Shows the Copy action button when `true` (default for non-streaming assistant turns). | | `onCopy` | `(text: string) => void` | `—` | Fired after copying message text. | | `onRetry` | `() => void` | `—` | Shows the Retry / Regenerate button when provided. | | `feedback` | `AiFeedbackValue` | `—` | Controlled thumbs up/down feedback state. | | `defaultFeedback` | `AiFeedbackValue` | `null` | Uncontrolled initial feedback state. | | `onFeedbackChange` | `(value: AiFeedbackValue) => void` | `—` | Fired when the user toggles thumbs up or thumbs down. | | `showFeedback` | `boolean` | `—` | Enables thumbs up/down action buttons (defaults to `true` when `onFeedbackChange` is provided or on assistant turns). | | `onFeedbackReason` | `(reason: string) => void` | `—` | Fired when the user picks a dislike reason chip. | | `branch` | `AiMessageBranch` | `—` | Optional response branch navigation (`1 / 2`). | | `followUps` | `readonly string[]` | `—` | Optional clickable follow-up prompts rendered beneath the action bar. | | `onFollowUp` | `(prompt: string) => void` | `—` | Callback invoked when the user selects a follow-up suggestion. | | `extraActions` | `ReactNode` | `—` | Extra custom buttons placed in the message action bar. | | `labels` | `Partial` | `—` | Localized labels and aria strings. | | `className` | `string` | `—` | Additional CSS class name applied to the root element. | | `style` | `CSSProperties` | `—` | Inline CSS styles applied to the root element. | --- ## Thinking Loader - **URL**: https://ui.biu.dev/docs/components/thinking-loader - **Category**: AI Agents - **Edition**: Open Source (MIT) - **Summary**: Compact working pill for AI replies with an eight-ray spinner and shimmering label rolling through phases before settling on a check. - **Install (shadcn)**: `pnpm dlx shadcn add @biudev/thinking-loader` - **Install (npm)**: `import { ThinkingLoader } from "@biudev/ui/thinking-loader"` - **Public Source**: https://ui.biu.dev/docs/source/thinking-loader ### Usage ```tsx import { ThinkingLoader } from "@/components/ui/biu/thinking-loader"; export function Example() { return ( ); } ``` ### API Reference #### ThinkingLoaderVariant Inherits: `'pill' & 'inline'` `'pill' | 'inline'` #### ThinkingLoaderSize Inherits: `'sm' & 'md'` `'sm' | 'md'` #### ThinkingLoaderProps | Prop | Type | Default | Description | | --- | --- | --- | --- | | `phases` | `readonly string[]` | `DEFAULT_THINKING_LOADER_PHASES` | Progressive status labels rolled through while working. | | `interval` | `number` | `2000` | Milliseconds per phase. Defaults to `2000`. | | `done` | `boolean` | `—` | Set `true` once work finishes to morph the 8-ray spinner into a check mark. | | `doneLabel` | `string` | `'Done'` | Label shown when `done` is `true`. Defaults to `'Done'`. | | `loop` | `boolean` | `false` | Automatically loops `phases -> done -> reset` for previews. Defaults to `false`. | | `holdMs` | `number` | `2600` | Hold duration in ms on the completed check state when `loop` is `true`. Defaults to `2600`. | | `variant` | `ThinkingLoaderVariant` | `'pill'` | Surface framing: `'pill'` (framed rounded badge) or `'inline'` (borderless). Defaults to `'pill'`. | | `size` | `ThinkingLoaderSize` | `'md'` | Compact `'sm'` or default `'md'` sizing. Defaults to `'md'`. | | `showTimer` | `boolean` | `false` | Show a subtle elapsed seconds counter beside the phase label. Defaults to `false`. | | `onPhaseChange` | `(index: number, phase: string) => void` | `—` | Fired whenever the active phase index advances. | | `onComplete` | `() => void` | `—` | Fired when a looping sequence reaches the `done` state. | | `className` | `string` | `—` | Additional CSS class name applied to the root element. | | `style` | `CSSProperties` | `—` | Inline CSS styles applied to the root element. | --- ## Thinking State - **URL**: https://ui.biu.dev/docs/components/thinking-state - **Category**: AI Agents - **Edition**: Open Source (MIT) - **Summary**: AI working timeline with animated pixel matrix, live timer, searched source chips, step-by-step reasoning, and drawn completion check. - **Install (shadcn)**: `pnpm dlx shadcn add @biudev/thinking-state` - **Install (npm)**: `import { ThinkingState } from "@biudev/ui/thinking-state"` - **Public Source**: https://ui.biu.dev/docs/source/thinking-state ### Usage ```tsx import { ThinkingState } from "@/components/ui/biu/thinking-state"; export function Example() { return ( ); } ``` ### API Reference #### ThinkingStateVariant Inherits: `'inline' & 'card'` `'inline' | 'card'` #### ThinkingStateSource | Prop | Type | Default | Description | | --- | --- | --- | --- | | `label` (required) | `string` | `—` | Visible text label or accessible name. | | `domain` | `string` | `—` | Hostname or domain label associated with a source. | | `href` | `string` | `—` | Navigation target URL. | | `monogram` | `string` | `—` | Single-character badge monogram for a source or brand. | | `color` | `string` | `—` | Accent or swatch CSS color value. | | `icon` | `ReactNode` | `—` | Leading icon element. | #### ThinkingStateStep Inherits: `string` | Prop | Type | Default | Description | | --- | --- | --- | --- | | `kind` | `'thinking' \| 'search'` | `—` | Entity or item classification kind. | | `text` | `string` | `—` | Plain text content for the item or status. | | `activeText` | `string` | `—` | Label shown while this step is actively running (e.g. `'Searching'` -> `'Searched'`). | | `status` | `'pending' \| 'running' \| 'done'` | `—` | Current lifecycle or execution status. | | `detail` | `string` | `—` | Additional detail text displayed when expanded or inspected. | | `badge` | `string` | `—` | Optional badge value or count displayed beside the label. | | `sources` | `readonly ThinkingStateSource[]` | `—` | Source pills displayed under a search step. | | `moreSources` | `readonly ThinkingStateSource[]` | `—` | Extra sources revealed when clicking the `+N more` pill. | #### ThinkingStateLabels | Prop | Type | Default | Description | | --- | --- | --- | --- | | `thinking` (required) | `string` | `—` | Label shown while the model is actively reasoning. | | `thoughtFor` (required) | `(seconds: string) => string` | `—` | Formatter for completed reasoning duration. | | `workedFor` (required) | `(seconds: string) => string` | `—` | Formatter for total agent work duration. | | `thoughtDone` (required) | `string` | `—` | Label shown when reasoning finished without a duration. | #### ThinkingStateProps | Prop | Type | Default | Description | | --- | --- | --- | --- | | `streaming` | `boolean` | `false` | Whether the model is actively reasoning/streaming. Defaults to `false`. | | `duration` | `number` | `—` | Elapsed duration in seconds (displayed once complete, or live while streaming if omitted). | | `open` | `boolean` | `—` | Controlled expanded state. | | `defaultOpen` | `boolean` | `—` | Uncontrolled initial expanded state. Defaults to `streaming` (or `true` when `stepMs` is set). | | `autoCollapse` | `boolean` | `—` | Automatically collapses when `streaming` transitions from `true` to `false`. Defaults to `true` (disabled automatically when `doneLabel` is set). | | `onOpenChange` | `(open: boolean) => void` | `—` | Callback invoked when the open state toggles. | | `variant` | `ThinkingStateVariant` | `'inline'` | Visual framing: `'inline'` (minimal subtle bar) or `'card'` (soft bordered container). Defaults to `'inline'`. | | `title` | `ReactNode` | `—` | Optional custom heading override (replaces `Thinking…` / `Thought for 4.2s`). | | `steps` | `readonly ThinkingStateStep[]` | `—` | Optional ordered reasoning and search steps displayed as a connected timeline. | | `doneLabel` | `string` | `—` | Label of the final completion row shown once reasoning finishes (e.g. `'Finished thinking'`). | | `stepMs` | `number` | `—` | When set (e.g. `1300`), automatically reveals `steps` one by one at this millisecond interval. | | `loop` | `boolean` | `false` | Automatically replays the `stepMs` sequence after `holdMs`. Defaults to `false`. | | `holdMs` | `number` | `3400` | Milliseconds to hold the completed state before looping. Defaults to `3400`. | | `onComplete` | `() => void` | `—` | Fired whenever an auto-stepping sequence finishes. | | `children` | `ReactNode` | `—` | Custom reasoning text or JSX body. | | `labels` | `Partial` | `—` | Localized labels. | | `className` | `string` | `—` | Additional CSS class name applied to the root element. | | `style` | `CSSProperties` | `—` | Inline CSS styles applied to the root element. | --- ## Message Scroller - **URL**: https://ui.biu.dev/docs/components/message-scroller - **Category**: AI Agents - **Edition**: BIU UI Pro (interactive preview & API public) - **Summary**: Streaming chat viewport that follows live output until scrolled away, with a floating Latest jump button and a minimalist message navigation rail. - **Install (Pro Registry)**: `npx shadcn@latest add @biudev-pro/message-scroller` (Pro license required) ### Usage ```tsx import { MessageScroller } from "@/components/ui/biu/message-scroller"; import { AiMessage } from "@/components/ui/biu/ai-message"; export function Example() { return ( ); } ``` ### API Reference #### MessageScrollerRole Inherits: `'user' & 'assistant' & 'system'` `'user' | 'assistant' | 'system'` #### MessageScrollerNavItem | Prop | Type | Default | Description | | --- | --- | --- | --- | | `id` (required) | `string` | `—` | Stable identifier derived from the rendered message element. | | `role` (required) | `MessageScrollerRole` | `—` | Speaker role used to style the rail tick and preview badge. | | `preview` (required) | `string` | `—` | Short single-line text preview extracted from the message. | | `index` (required) | `number` | `—` | Zero-based turn index in the rendered transcript. | #### MessageScrollerLabels | Prop | Type | Default | Description | | --- | --- | --- | --- | | `label` (required) | `string` | `—` | Default accessible label for the transcript `role="log"`. | | `jumpToLatest` (required) | `string` | `—` | Label shown on the floating jump-to-latest button. | | `navigationLabel` (required) | `string` | `—` | Accessible label for the optional right-hand navigation rail. | | `preview` (required) | `string` | `—` | Accessible label for the hover/focus rail preview card. | | `goToUser` (required) | `string` | `—` | Speaker prefix for user turns in the navigation rail. | | `goToAssistant` (required) | `string` | `—` | Speaker prefix for assistant turns in the navigation rail. | | `goToMessage` (required) | `string` | `—` | Fallback speaker prefix for system or untyped turns. | #### MessageScrollerProps | Prop | Type | Default | Description | | --- | --- | --- | --- | | `children` (required) | `ReactNode` | `—` | Message elements rendered inside the scrollable transcript log. | | `followOutput` | `boolean` | `true` | Keep streamed output pinned while the reader remains near the end. Defaults to `true`. | | `followThreshold` | `number` | `56` | Pixel distance from the bottom edge that still counts as following live output. Defaults to `56`. | | `smooth` | `boolean` | `true` | Smoothly follow growing content and scroll jumps. Defaults to `true`. | | `onFollowChange` | `(following: boolean) => void` | `—` | Reports whenever the reader leaves or returns to the live bottom edge. | | `label` | `string` | `—` | Accessible label for the scrollable transcript log. | | `busy` | `boolean` | `false` | Marks the transcript as actively streaming or awaiting more output (`aria-busy`). | | `navigation` | `'rail'` | `—` | Adds a compact minimalist rail along the right edge for jumping between message rows. | | `jumpButton` | `boolean` | `true` | Shows a floating button back to the latest message once scrolled up. Defaults to `true`. | | `navigationLabel` | `string` | `—` | Accessible label for the optional message navigation rail. | | `viewportClassName` | `string` | `—` | Extra classes merged onto the scrolling viewport wrapper. | | `contentClassName` | `string` | `—` | Extra classes merged onto the `role="log"` element wrapping messages. | | `railClassName` | `string` | `—` | Extra classes merged onto the navigation rail when `navigation="rail"`. | | `viewportRef` | `Ref` | `—` | Ref assigned to the underlying scrolling viewport element. | | `viewportProps` | `Omit, 'children' \| 'ref' \| 'className'>` | `—` | Extra HTML attributes merged onto the outer viewport container. | | `contentProps` | `Omit, 'children' \| 'ref' \| 'className'>` | `—` | Extra HTML attributes merged onto the `role="log"` content element. | | `labels` | `Partial` | `—` | Localized accessible strings and labels. | | `className` | `string` | `—` | Additional CSS class name applied to the root element. | | `style` | `CSSProperties` | `—` | Inline CSS styles applied to the root element. | --- ## Tool Call Card - **URL**: https://ui.biu.dev/docs/components/tool-call-card - **Category**: AI Agents - **Edition**: BIU UI Pro (interactive preview & API public) - **Summary**: Expandable agent tool invocation cards with running, success, and error states, latency timers, and copyable JSON input/output blocks. - **Install (Pro Registry)**: `npx shadcn@latest add @biudev-pro/tool-call-card` (Pro license required) ### Usage ```tsx import { ToolCallCard } from "@/components/ui/biu/tool-call-card"; export function Example() { return ( ); } ``` ### API Reference #### ToolCallStatus Inherits: `'pending' & 'running' & 'success' & 'error'` `'pending' | 'running' | 'success' | 'error'` #### ToolCallCardLabels | Prop | Type | Default | Description | | --- | --- | --- | --- | | `input` (required) | `string` | `—` | Structured input payload passed to the tool. | | `output` (required) | `string` | `—` | Structured output returned by the tool. | | `error` (required) | `string` | `—` | Validation error message or error state. | | `copy` (required) | `string` | `—` | Label for the copy action button. | | `copied` (required) | `string` | `—` | Label shown after content is copied. | | `statusLabels` (required) | `Record` | `—` | Localized labels mapped to each execution status. | #### ToolCallCardProps | Prop | Type | Default | Description | | --- | --- | --- | --- | | `name` (required) | `string` | `—` | Tool or function identifier (e.g. `'read_file'`, `'search_docs'`, `'run_sql'`). | | `summary` | `string` | `—` | Short argument or target summary shown inline beside the tool name (e.g. `'src/router.ts'`). | | `status` | `ToolCallStatus` | `'success'` | Execution lifecycle status. Defaults to `'success'`. | | `duration` | `string` | `—` | Formatted duration string (e.g. `'142ms'`, `'1.8s'`). | | `icon` | `ReactNode` | `—` | Optional decorative icon replacing the default status indicator. | | `input` | `unknown` | `—` | Structured input arguments or command string shown when expanded. | | `output` | `unknown` | `—` | Structured tool result or log output shown when expanded. | | `error` | `string` | `—` | Error message shown in a highlighted red block when `status === 'error'`. | | `children` | `ReactNode` | `—` | Custom expanded detail content rendered below input/output. | | `open` | `boolean` | `—` | Controlled expanded state. | | `defaultOpen` | `boolean` | `false` | Uncontrolled initial expanded state. Defaults to `false`. | | `onOpenChange` | `(open: boolean) => void` | `—` | Callback invoked when the open state toggles. | | `variant` | `'card' \| 'compact'` | `'card'` | Visual framing: `'card'` (bordered tile) or `'compact'` (quiet borderless row). Defaults to `'card'`. | | `labels` | `Partial` | `—` | Localized labels. | | `className` | `string` | `—` | Additional CSS class name applied to the root element. | | `style` | `CSSProperties` | `—` | Inline CSS styles applied to the root element. | #### ToolCallGroupProps | Prop | Type | Default | Description | | --- | --- | --- | --- | | `children` (required) | `ReactNode` | `—` | Nested React content rendered inside the component. | | `className` | `string` | `—` | Additional CSS class name applied to the root element. | | `style` | `CSSProperties` | `—` | Inline CSS styles applied to the root element. | --- ## Approval Card - **URL**: https://ui.biu.dev/docs/components/approval-card - **Category**: AI Agents - **Edition**: BIU UI Pro (interactive preview & API public) - **Summary**: Human-in-the-loop authorization gate with risk badges, command preview, Allow once / Always allow / Reject actions, and optional rejection note. - **Install (Pro Registry)**: `npx shadcn@latest add @biudev-pro/approval-card` (Pro license required) ### Usage ```tsx import { ApprovalCard } from "@/components/ui/biu/approval-card"; export function Example() { return ( console.log(decision)} /> ); } ``` ### API Reference #### ApprovalStatus Inherits: `'pending' & 'approved' & 'always-approved' & 'rejected'` `'pending' | 'approved' | 'always-approved' | 'rejected'` #### ApprovalRisk Inherits: `'low' & 'medium' & 'high'` `'low' | 'medium' | 'high'` #### ApprovalDetail | Prop | Type | Default | Description | | --- | --- | --- | --- | | `label` (required) | `string` | `—` | Visible text label or accessible name. | | `value` (required) | `string` | `—` | Controlled current value. | #### ApprovalCardLabels | Prop | Type | Default | Description | | --- | --- | --- | --- | | `eyebrow` (required) | `string` | `—` | Small uppercase eyebrow label above the card title. | | `allow` (required) | `string` | `—` | Label for the Allow once button. | | `alwaysAllow` (required) | `string` | `—` | Label for the Always allow button. | | `reject` (required) | `string` | `—` | Label for the Reject button. | | `rejectPlaceholder` (required) | `string` | `—` | Placeholder text for the optional rejection reason input. | | `confirmReject` (required) | `string` | `—` | Label for confirming rejection. | | `cancel` (required) | `string` | `—` | Label for cancelling the rejection form. | | `approved` (required) | `string` | `—` | Status badge label after approval. | | `alwaysApproved` (required) | `string` | `—` | Status badge label after persistent approval. | | `rejected` (required) | `string` | `—` | Status badge label after rejection. | | `riskLabels` (required) | `Record` | `—` | Localized labels mapped to approval risk levels. | #### ApprovalCardProps | Prop | Type | Default | Description | | --- | --- | --- | --- | | `title` (required) | `string` | `—` | Headline summarizing the requested agent action (e.g. `'Run database migration'`). | | `description` | `string` | `—` | Optional explanation of why the agent wants to perform this action. | | `tool` | `string` | `—` | Tool or target identifier displayed as a compact code badge (e.g. `'shell.exec'`). | | `command` | `string` | `—` | Command or payload preview rendered in a monospace block. | | `details` | `readonly ApprovalDetail[]` | `—` | Optional key-value metadata rows (e.g. Target, Scope, Impact). | | `risk` | `ApprovalRisk` | `'medium'` | Risk level controlling the header accent pill. Defaults to `'medium'`. | | `status` | `ApprovalStatus` | `—` | Controlled decision state. | | `defaultStatus` | `ApprovalStatus` | `'pending'` | Uncontrolled initial decision state. Defaults to `'pending'`. | | `onDecision` | `(decision: Exclude, reason?: string) => void` | `—` | Fired when the user approves once (`'approved'`), always approves (`'always-approved'`), or rejects (`'rejected'`). | | `allowAlways` | `boolean` | `true` | Shows the `'Always allow'` secondary option when `true`. Defaults to `true`. | | `collectRejectReason` | `boolean` | `false` | Prompts for an optional rejection note when clicking Reject. Defaults to `false`. | | `children` | `ReactNode` | `—` | Custom extra content rendered inside the card body. | | `labels` | `Partial` | `—` | Localized labels. | | `className` | `string` | `—` | Additional CSS class name applied to the root element. | | `style` | `CSSProperties` | `—` | Inline CSS styles applied to the root element. | --- ## Decision Card - **URL**: https://ui.biu.dev/docs/components/decision-card - **Category**: AI Agents - **Edition**: BIU UI Pro (interactive preview & API public) - **Summary**: Queued agent decision card docked above the chat composer with numbered 1–5 options, Recommended badge, preview tiles, custom reply row, and Later folding. - **Install (Pro Registry)**: `npx shadcn@latest add @biudev-pro/decision-card` (Pro license required) ### Usage ```tsx import { DecisionCard } from "@/components/ui/biu/decision-card"; export function Example() { return ( console.log(id, answer)} /> ); } ``` ### API Reference #### DecisionKind Inherits: `'options' & 'approval' & 'tiles'` `'options' | 'approval' | 'tiles'` #### DecisionOption | Prop | Type | Default | Description | | --- | --- | --- | --- | | `id` (required) | `string` | `—` | Unique option identifier returned in `onDecide`. | | `label` (required) | `string` | `—` | Primary option title. | | `description` | `string` | `—` | Optional rationale or trade-off description shown beneath the label. | | `recommended` | `boolean` | `—` | Highlights this option with a Recommended badge. | | `preview` | `ReactNode` | `—` | Optional custom preview visual rendered in `'tiles'` mode. | | `badge` | `string` | `—` | Optional secondary metadata pill (e.g. cost, latency, tag). | #### DecisionItem | Prop | Type | Default | Description | | --- | --- | --- | --- | | `id` (required) | `string` | `—` | Unique decision identifier. | | `question` (required) | `string` | `—` | The question the agent needs answered before continuing. | | `description` | `string` | `—` | Optional supporting context beneath the question. | | `task` | `string` | `—` | Originating task, run, or agent label shown in the top bar. | | `eyebrow` | `string` | `—` | Custom eyebrow pill overriding `labels.eyebrow`. | | `kind` | `DecisionKind` | `—` | Presentation mode: numbered `'options'` (default), `'approval'`, or `'tiles'`. | | `options` | `readonly DecisionOption[]` | `—` | Selectable choices for `'options'` and `'tiles'` kinds. | | `allowCustom` | `boolean` | `—` | Shows the final free-text row so the user can reply in their own words. Defaults to `true`. | | `customPlaceholder` | `string` | `—` | Placeholder copy for the free-text row. | | `approveLabel` | `string` | `—` | Custom approve button copy when `kind="approval"`. | | `declineLabel` | `string` | `—` | Custom decline button copy when `kind="approval"`. | #### DecisionOptionAnswer | Prop | Type | Default | Description | | --- | --- | --- | --- | | `option` (required) | `string` | `—` | Selected option or tile identifier. | #### DecisionTextAnswer | Prop | Type | Default | Description | | --- | --- | --- | --- | | `text` (required) | `string` | `—` | Free-text answer entered by the user. | #### DecisionAnswer Inherits: `DecisionOptionAnswer & DecisionTextAnswer & 'approve' & 'decline'` `DecisionOptionAnswer | DecisionTextAnswer | 'approve' | 'decline'` #### DecisionCardLabels | Prop | Type | Default | Description | | --- | --- | --- | --- | | `eyebrow` (required) | `string` | `—` | Default eyebrow pill text shown in the card header. | | `recommended` (required) | `string` | `—` | Badge label rendered beside recommended options. | | `later` (required) | `string` | `—` | Button label that folds the decision card for later. | | `resume` (required) | `(count: number) => string` | `—` | Formatter returning the folded bar summary for `count` queued decisions. | | `customPlaceholder` (required) | `string` | `—` | Default placeholder for the custom-answer text input. | | `submitCustom` (required) | `string` | `—` | Accessible label for the custom-answer submit button. | | `approve` (required) | `string` | `—` | Default primary button label in `'approval'` mode. | | `decline` (required) | `string` | `—` | Default secondary button label in `'approval'` mode. | | `prevDecision` (required) | `string` | `—` | Accessible label for the previous-decision pager button. | | `nextDecision` (required) | `string` | `—` | Accessible label for the next-decision pager button. | | `pager` (required) | `(current: number, total: number) => string` | `—` | Formatter for the pager indicator (e.g. `'1 of 3'`). | | `keyboardHint` (required) | `string` | `—` | Optional keyboard shortcut hint text. | #### DecisionCardProps | Prop | Type | Default | Description | | --- | --- | --- | --- | | `decisions` (required) | `readonly DecisionItem[]` | `—` | Open decisions ordered oldest-first; drop answered items from the array in `onDecide`. | | `onDecide` | `(id: string, answer: DecisionAnswer) => void` | `—` | Fired when the user picks an option/tile, approves/declines, or submits custom words. | | `onLater` | `(id: string) => void` | `—` | Fired when the user clicks Later to defer the active decision. | | `folded` | `boolean` | `—` | Controlled collapsed state when deferred to a single line. | | `defaultFolded` | `boolean` | `false` | Initial uncontrolled folded state. Defaults to `false`. | | `onFoldedChange` | `(folded: boolean) => void` | `—` | Fired when the card folds via Later or unfolds via Resume. | | `activeIndex` | `number` | `—` | Controlled zero-based index of the currently displayed decision. | | `onActiveIndexChange` | `(index: number) => void` | `—` | Fired when the user steps through queued decisions with the pager. | | `keyboardShortcuts` | `boolean` | `true` | Enables keyboard shortcuts (`1-5`, arrows, Enter, Escape) while focus is inside the card. Defaults to `true`. | | `labels` | `Partial` | `—` | Localized labels and accessible strings. | | `'aria-label'` | `string` | `'Agent decision'` | Accessible label for the decision card region. | | `className` | `string` | `—` | Additional CSS class name applied to the root element. | | `style` | `CSSProperties` | `—` | Inline CSS styles applied to the root element. | --- ## Agent Activity - **URL**: https://ui.biu.dev/docs/components/agent-activity - **Category**: AI Agents - **Edition**: BIU UI Pro (interactive preview & API public) - **Summary**: Connected vertical execution plan & step timeline with live progress bar, collapsible card, agent tags, and clickable step inspection. - **Install (Pro Registry)**: `npx shadcn@latest add @biudev-pro/agent-activity` (Pro license required) ### Usage ```tsx import { AgentActivity } from "@/components/ui/biu/agent-activity"; export function Example() { return ( ); } ``` ### API Reference #### AgentStepStatus Inherits: `'pending' & 'running' & 'done' & 'blocked' & 'skipped'` `'pending' | 'running' | 'done' | 'blocked' | 'skipped'` #### AgentActivityStep | Prop | Type | Default | Description | | --- | --- | --- | --- | | `id` (required) | `string` | `—` | Unique identifier for this element or item. | | `title` (required) | `string` | `—` | Primary heading or title text. | | `status` (required) | `AgentStepStatus` | `—` | Current lifecycle or execution status. | | `detail` | `string` | `—` | Optional secondary description or live output summary. | | `tag` | `string` | `—` | Optional agent or tool badge (e.g. `'Scout'`, `'read_file'`). | | `duration` | `string` | `—` | Optional elapsed duration (e.g. `'1.4s'`, `'240ms'`). | | `timestamp` | `string` | `—` | Optional timestamp (e.g. `'10:42:08'`). | #### AgentActivityLabels | Prop | Type | Default | Description | | --- | --- | --- | --- | | `progress` (required) | `(done: number, total: number) => string` | `—` | Completion percentage (0–100) for running progress bars. | | `statusLabels` (required) | `Record` | `—` | Localized labels mapped to each execution status. | #### AgentActivityProps | Prop | Type | Default | Description | | --- | --- | --- | --- | | `title` | `string` | `'Execution plan'` | Plan or run title shown in the header (e.g. `'Execution plan'`). | | `subtitle` | `string` | `—` | Optional subtitle shown beside or below the title. | | `steps` (required) | `readonly AgentActivityStep[]` | `—` | Ordered execution steps. | | `variant` | `'card' \| 'inline'` | `'card'` | Visual framing: `'card'` (framed container with header) or `'inline'` (borderless timeline). Defaults to `'card'`. | | `showProgress` | `boolean` | `true` | Shows a slim progress bar in the header when `variant === 'card'`. Defaults to `true`. | | `collapsible` | `boolean` | `false` | Allows collapsing/expanding the step list from the header. Defaults to `false`. | | `open` | `boolean` | `—` | Controlled open visibility state. | | `defaultOpen` | `boolean` | `true` | Initial open state when uncontrolled. | | `onOpenChange` | `(open: boolean) => void` | `—` | Callback invoked when the open state toggles. | | `activeStepId` | `string \| null` | `—` | Currently selected step id (highlighted when steps are clickable). | | `onStepClick` | `(step: AgentActivityStep) => void` | `—` | Makes steps interactive buttons and fires when a step is clicked. | | `headerAction` | `ReactNode` | `—` | Optional trailing header control (e.g. Pause/Resume button). | | `footer` | `ReactNode` | `—` | Optional footer slot beneath the timeline (e.g. token & cost summary). | | `labels` | `Partial` | `—` | Localized labels. | | `className` | `string` | `—` | Additional CSS class name applied to the root element. | | `style` | `CSSProperties` | `—` | Inline CSS styles applied to the root element. | --- ## Button - **URL**: https://ui.biu.dev/docs/components/button - **Category**: Actions - **Edition**: Open Source (MIT) - **Summary**: Trigger actions with primary, secondary, ghost, destructive, and animated loading states. - **Install (shadcn)**: `pnpm dlx shadcn add @biudev/button` - **Install (npm)**: `import { Button } from "@biudev/ui/button"` - **Public Source**: https://ui.biu.dev/docs/source/button ### Usage ```tsx import { useState } from "react"; import { Button } from "@/components/ui/biu/button"; export function Example() { const [saved, setSaved] = useState(false); return ; } ``` ### API Reference #### ButtonProps Inherits: `ComponentPropsWithRef<'button'>` | Prop | Type | Default | Description | | --- | --- | --- | --- | | `variant` | `'primary' \| 'secondary' \| 'ghost' \| 'destructive'` | `'primary'` | Visual style variant of the button. | | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Height and padding scale of the button. | | `loading` | `boolean` | `false` | Shows a loading indicator and suppresses click activation while busy. | | `icon` | `ReactNode` | `—` | Leading icon rendered before the button label. | | `iconRight` | `ReactNode` | `—` | Trailing icon rendered after the button label. | #### ButtonLinkProps Inherits: `ComponentPropsWithRef<'a'>` | Prop | Type | Default | Description | | --- | --- | --- | --- | | `variant` | `ButtonProps['variant']` | `'primary'` | Visual style variant of the link button. | | `size` | `ButtonProps['size']` | `'md'` | Height and padding scale of the link button. | | `icon` | `ReactNode` | `—` | Leading icon rendered before the link label. | | `iconRight` | `ReactNode` | `—` | Trailing icon rendered after the link label. | | `disabled` | `boolean` | `false` | Disables navigation and applies disabled styling. | --- ## Button Group - **URL**: https://ui.biu.dev/docs/components/button-group - **Category**: Actions - **Edition**: Open Source (MIT) - **Summary**: Group related actions and split buttons with unified tactile geometry. - **Install (shadcn)**: `pnpm dlx shadcn add @biudev/button-group` - **Install (npm)**: `import { ButtonGroup } from "@biudev/ui/button-group"` - **Public Source**: https://ui.biu.dev/docs/source/button-group ### Usage ```tsx import { useState } from "react"; import { Button } from "@/components/ui/biu/button"; import { ButtonGroup } from "@/components/ui/biu/button-group"; export function Example() { const [alignment, setAlignment] = useState("Left"); return (

Selected: {alignment}

); } ``` ### API Reference #### ButtonGroupProps Inherits: `ComponentPropsWithRef<'div'>` | Prop | Type | Default | Description | | --- | --- | --- | --- | | `children` (required) | `ReactNode` | `—` | Nested React content rendered inside the component. | | `variant` | `ButtonProps['variant']` | `—` | Visual style variant. | | `size` | `ButtonProps['size']` | `—` | Size tier controlling height, padding, and typography. | | `disabled` | `boolean` | `—` | Disables interaction and applies disabled styling. | | `orientation` | `'horizontal'\|'vertical'` | `'horizontal'` | Layout axis (horizontal or vertical). | | `fullWidth` | `boolean` | `false` | Stretches the control to fill 100% of its container width. | | `separators` | `boolean` | `true` | Shows subtle divider lines between grouped buttons. | --- ## Icon Button - **URL**: https://ui.biu.dev/docs/components/icon-button - **Category**: Actions - **Edition**: Open Source (MIT) - **Summary**: Compact icon-only actions with required accessible labels and pressed toggle state. - **Install (shadcn)**: `pnpm dlx shadcn add @biudev/icon-button` - **Install (npm)**: `import { IconButton } from "@biudev/ui/icon-button"` - **Public Source**: https://ui.biu.dev/docs/source/icon-button ### Usage ```tsx import { useState } from "react"; import { Filter, Pin, Plus } from "lucide-react"; import { IconButton } from "@/components/ui/biu/icon-button"; export function RunsToolbar({ onFilter, onNew }: { onFilter: () => void; onNew: () => void }) { const [pinned, setPinned] = useState(false); return (
} onClick={onFilter} /> } pressed={pinned} onClick={() => setPinned((value) => !value)} /> } onClick={onNew} />
); } ``` ### API Reference #### IconButtonProps Inherits: `Omit,'children'>` | Prop | Type | Default | Description | | --- | --- | --- | --- | | `label` (required) | `string` | `—` | Visible text label or accessible name. | | `icon` (required) | `ReactNode` | `—` | Leading icon element. | | `variant` | `'ghost'\|'secondary'\|'primary'` | `'ghost'` | Visual style variant. | | `size` | `'sm'\|'md'` | `'md'` | Size tier controlling height, padding, and typography. | | `pressed` | `boolean` | `—` | Controlled pressed toggle state for icon buttons. | --- ## Input - **URL**: https://ui.biu.dev/docs/components/input - **Category**: Forms & Inputs - **Edition**: Open Source (MIT) - **Summary**: Single-line text fields with labels, hints, copyable text, validation errors, and clear controls. - **Install (shadcn)**: `pnpm dlx shadcn add @biudev/input` - **Install (npm)**: `import { Input } from "@biudev/ui/input"` - **Public Source**: https://ui.biu.dev/docs/source/input ### Usage ```tsx import { TextField } from "@/components/ui/biu/input"; export function Example() { return ; } ``` ### API Reference #### InputProps Inherits: `ComponentPropsWithRef<'input'>` `ComponentPropsWithRef<'input'>` #### TextFieldProps Inherits: `Omit, 'size' | 'prefix'>` | Prop | Type | Default | Description | | --- | --- | --- | --- | | `label` | `ReactNode` | `—` | Visible text label or accessible name. | | `hint` | `ReactNode` | `—` | Helper text or inline hint shown alongside the item or field. | | `error` | `ReactNode` | `—` | Validation error message or error state. | | `prefix` | `ReactNode` | `—` | Leading static affix rendered inside the input box. | | `suffix` | `ReactNode` | `—` | Trailing static affix rendered inside the input box. | | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Size tier controlling height, padding, and typography. | | `optional` | `boolean` | `—` | Displays an optional badge next to the field label. | | `optionalText` | `string` | `'Optional'` | Custom text for the optional indicator badge. | | `actionLabels` | `{ clear?: string; showPassword?: string; hidePassword?: string; copy?: string; copied?: string }` | `—` | Localized accessible labels for inline field actions. | | `clearable` | `boolean` | `—` | Shows a clear button when the field has a value. | | `copyable` | `boolean` | `—` | Shows a one-click copy button inside the input. | | `counter` | `boolean` | `—` | Shows a live character counter below the field. | | `onClear` | `() => void` | `—` | Callback fired after clearing the input value. | | `inputClassName` | `string` | `—` | Additional CSS class name applied to the inner input element. | --- ## Text Area - **URL**: https://ui.biu.dev/docs/components/text-area - **Category**: Forms & Inputs - **Edition**: Open Source (MIT) - **Summary**: Multi-line text input with auto-grow sizing and live character count feedback. - **Install (shadcn)**: `pnpm dlx shadcn add @biudev/text-area` - **Install (npm)**: `import { TextArea } from "@biudev/ui/text-area"` - **Public Source**: https://ui.biu.dev/docs/source/text-area ### Usage ```tsx import { TextArea } from "@/components/ui/biu/text-area"; export function Example() { return