# LoveUI full LLM context Open-source React components, examples, and patterns for building polished product interfaces with Tailwind CSS. Use this file when answering implementation questions about LoveUI. Prefer exact component pages, registry example names, and source snippets from the linked documentation over generic UI advice. Primary URLs: - Documentation: https://www.loveui.dev/docs - Components: https://www.loveui.dev/components - GitHub: https://github.com/loveconnor/loveui # Component catalog ## Accordion (https://www.loveui.dev/components/accordion) A set of collapsible panels with headings. - Example count: 5 - Example registry names: accordion-demo, accordion-controlled, accordion-multiple, accordion-product-faq, accordion-single ## Alert (https://www.loveui.dev/components/alert) A callout for information and a blocking dialog for decisions. - Example count: 10 - Example registry names: alert-demo, alert-billing-notice, alert-dialog-demo, alert-error, alert-info, alert-success, alert-warning, alert-with-icon, alert-with-icon-action, dialog-close-confirmation ## Autocomplete (https://www.loveui.dev/components/autocomplete) An input that suggests options as you type. - Example count: 14 - Example registry names: autocomplete-demo, autocomplete-async, autocomplete-autohighlight, autocomplete-disabled, autocomplete-form, autocomplete-grouped, autocomplete-inline, autocomplete-lg, autocomplete-limit, autocomplete-members, autocomplete-sm, autocomplete-with-clear, autocomplete-with-label, autocomplete-with-trigger-clear ## Avatar (https://www.loveui.dev/components/avatar) An image element with a fallback for representing the user. - Example count: 6 - Example registry names: avatar-demo, avatar-fallback, avatar-group, avatar-radius, avatar-size, avatar-team-stack ## Badge (https://www.loveui.dev/components/badge) A badge or a component that looks like a badge. - Example count: 13 - Example registry names: badge-demo, badge-destructive, badge-error, badge-info, badge-lg, badge-outline, badge-release-status, badge-secondary, badge-sm, badge-success, badge-warning, badge-with-icon, badge-with-link ## Breadcrumb (https://www.loveui.dev/components/breadcrumb) Displays the path to the current resource using a hierarchy of links. - Example count: 5 - Example registry names: breadcrumb-demo, breadcrumb-compact-path, breadcrumb-custom-separator, breadcrumb-with-ellipsis, breadcrumb-workspace-path ## Button (https://www.loveui.dev/components/button) A button or a component that looks like a button. - Example count: 19 - Example registry names: button-demo, button-command-bar, button-destructive, button-destructive-outline, button-disabled, button-ghost, button-icon, button-icon-lg, button-icon-sm, button-lg, button-link, button-loading, button-outline, button-secondary, button-sm, button-with-icon, button-with-link, button-xl, button-xs ## Card (https://www.loveui.dev/components/card) A content container for grouping related information. - Example count: 4 - Example registry names: card-demo, card-billing-plan, card-metric-summary, card-team-member ## Checkbox (https://www.loveui.dev/components/checkbox) A control for checked state, with optional grouped selection. - Example count: 11 - Example registry names: checkbox-demo, checkbox-card, checkbox-disabled, checkbox-form, checkbox-group-demo, checkbox-group-disabled, checkbox-group-form, checkbox-group-nested-parent, checkbox-group-parent, checkbox-notification-row, checkbox-with-description ## Collapsible (https://www.loveui.dev/components/collapsible) A collapsible panel controlled by a button. - Example count: 4 - Example registry names: collapsible-demo, collapsible-checklist, collapsible-command-help, collapsible-release-notes ## Combobox (https://www.loveui.dev/components/combobox) An input combined with a list of predefined items to select. - Example count: 13 - Example registry names: combobox-demo, combobox-assignee, combobox-autohighlight, combobox-disabled, combobox-form, combobox-grouped, combobox-lg, combobox-multiple, combobox-multiple-form, combobox-sm, combobox-with-clear, combobox-with-inner-input, combobox-with-label ## Dialog (https://www.loveui.dev/components/dialog) A popup that opens on top of the entire page. - Example count: 5 - Example registry names: dialog-demo, dialog-close-confirmation, dialog-from-menu, dialog-invite-member, dialog-nested ## Empty (https://www.loveui.dev/components/empty) A container for displaying empty state information. - Example count: 4 - Example registry names: empty-demo, empty-filtered-results, empty-inbox-zero, empty-upload-queue ## Field (https://www.loveui.dev/components/field) A component that provides labelling and validation for form controls. - Example count: 18 - Example registry names: field-demo, field-autocomplete, field-checkbox, field-checkbox-group, field-combobox, field-combobox-multiple, field-complete-form, field-disabled, field-error, field-number-field, field-password, field-radio, field-required, field-select, field-slider, field-switch, field-textarea, field-validity ## Fieldset (https://www.loveui.dev/components/fieldset) A native fieldset element with a legend. - Example count: 4 - Example registry names: fieldset-demo, fieldset-billing-address, fieldset-danger-zone, fieldset-notification-settings ## Form (https://www.loveui.dev/components/form) A form wrapper component that simplifies validation and submission. - Example count: 4 - Example registry names: form-demo, form-newsletter, form-profile-card, form-zod ## Frame (https://www.loveui.dev/components/frame) A framed container for grouping related information. - Example count: 4 - Example registry names: frame-demo, frame-analytics-panel, frame-code-output, frame-device-preview ## Group (https://www.loveui.dev/components/group) A component for visually grouping a series of controls. - Example count: 5 - Example registry names: group-demo, group-filter-actions, group-segmented-filters, group-toolbar-actions, group-with-input ## Input (https://www.loveui.dev/components/input) A native input element. - Example count: 8 - Example registry names: input-demo, input-disabled, input-file, input-lg, input-search-inline, input-sm, input-with-button, input-with-label ## Label (https://www.loveui.dev/components/label) Renders an accessible label associated with controls. - Example count: 6 - Example registry names: autocomplete-with-label, checkbox-demo, combobox-with-label, input-with-label, number-field-with-label, textarea-with-label ## Menu (https://www.loveui.dev/components/menu) A list of actions in a dropdown, enhanced with keyboard navigation. - Example count: 9 - Example registry names: menu-demo, menu-checkbox, menu-close-on-click, menu-group-labels, menu-hover, menu-link, menu-nested, menu-project-actions, menu-radio-group ## Meter (https://www.loveui.dev/components/meter) A graphical display of a numeric value within a range. - Example count: 5 - Example registry names: meter-demo, meter-simple, meter-storage-quota, meter-with-formatted-value, meter-with-range ## Number Field (https://www.loveui.dev/components/number-field) A numeric input element with increment and decrement buttons, and a scrub area. - Example count: 11 - Example registry names: number-field-demo, number-field-disabled, number-field-form, number-field-lg, number-field-sm, number-field-ticket-count, number-field-with-formatted-value, number-field-with-label, number-field-with-range, number-field-with-scrub, number-field-with-step ## Pagination (https://www.loveui.dev/components/pagination) A pagination with page navigation, next and previous links. - Example count: 4 - Example registry names: pagination-demo, pagination-compact, pagination-mini, pagination-results ## Popover (https://www.loveui.dev/components/popover) An accessible popup anchored to a button. - Example count: 4 - Example registry names: popover-demo, popover-account-summary, popover-color-swatch, popover-with-close ## Preview Card (https://www.loveui.dev/components/preview-card) A popup that appears when a link is hovered, showing a preview for sighted users. - Example count: 4 - Example registry names: preview-card-demo, preview-card-product, preview-card-profile, preview-card-repository ## Progress (https://www.loveui.dev/components/progress) Displays the status of a task that takes a long time. - Example count: 4 - Example registry names: progress-demo, progress-onboarding, progress-with-formatted-value, progress-with-label-value ## Radio Group (https://www.loveui.dev/components/radio-group) A set of checkable buttons where no more than one of the buttons can be checked at a time. - Example count: 6 - Example registry names: radio-group-demo, radio-group-card, radio-group-delivery, radio-group-disabled, radio-group-form, radio-group-with-description ## Scroll Area (https://www.loveui.dev/components/scroll-area) A native scroll container with custom scrollbars. - Example count: 4 - Example registry names: scroll-area-demo, scroll-area-activity, scroll-area-both, scroll-area-horizontal ## Select (https://www.loveui.dev/components/select) A common form component for choosing a predefined value in a dropdown menu. - Example count: 9 - Example registry names: select-demo, select-disabled, select-form, select-lg, select-multiple, select-sm, select-timezone, select-with-groups, select-without-alignment ## Separator (https://www.loveui.dev/components/separator) A separator element accessible to screen readers. - Example count: 4 - Example registry names: separator-demo, separator-section-label, separator-timeline, separator-vertical-stack ## Sheet (https://www.loveui.dev/components/sheet) A flyout that opens from the side of the screen, based on the dialog component. - Example count: 4 - Example registry names: sheet-demo, sheet-checkout-summary, sheet-position, sheet-profile-editor ## Skeleton (https://www.loveui.dev/components/skeleton) A loading state skeleton for your components. - Example count: 4 - Example registry names: skeleton-demo, skeleton-chat-list, skeleton-dashboard-card, skeleton-only ## Slider (https://www.loveui.dev/components/slider) An input where the user selects a value from within a given range. - Example count: 6 - Example registry names: slider-demo, slider-form, slider-opacity, slider-range, slider-vertical, slider-with-label-value ## Switch (https://www.loveui.dev/components/switch) A control that indicates whether a setting is on or off. - Example count: 6 - Example registry names: switch-demo, switch-card, switch-disabled, switch-form, switch-privacy-mode, switch-with-description ## Table (https://www.loveui.dev/components/table) A simple table component for displaying tabular data. - Example count: 4 - Example registry names: table-demo, table-framed, table-invoice-list, table-user-roles ## Tabs (https://www.loveui.dev/components/tabs) A component for toggling between related panels on the same page. - Example count: 5 - Example registry names: tabs-demo, tabs-settings, tabs-underline, tabs-underline-vertical, tabs-vertical ## Textarea (https://www.loveui.dev/components/textarea) A native textarea element. - Example count: 7 - Example registry names: textarea-demo, textarea-disabled, textarea-feedback, textarea-form, textarea-lg, textarea-sm, textarea-with-label ## Toast (https://www.loveui.dev/components/toast) Generates standard and gooey toast notifications. - Example count: 12 - Example registry names: toast-demo, gooey-toast-demo, gooey-toast-position, gooey-toast-promise, gooey-toast-states, gooey-toast-with-button, toast-heights, toast-loading, toast-promise, toast-sync-complete, toast-with-action, toast-with-status ## Toggle (https://www.loveui.dev/components/toggle) A two-state button that can stand alone or work inside a group. - Example count: 17 - Example registry names: toggle-demo, toggle-disabled, toggle-group-demo, toggle-group-disabled, toggle-group-lg, toggle-group-multiple, toggle-group-outline, toggle-group-outline-with-separator, toggle-group-sm, toggle-group-with-disabled-item, toggle-icon-group, toggle-lg, toggle-outline, toggle-sm, toggle-view-mode, toggle-with-icon, tooltip-grouped ## Toolbar (https://www.loveui.dev/components/toolbar) A container for grouping a set of buttons and controls. - Example count: 4 - Example registry names: toolbar-demo, toolbar-canvas-controls, toolbar-density-controls, toolbar-media-controls ## Tooltip (https://www.loveui.dev/components/tooltip) A popup that appears when an element is hovered or focused, showing a hint for sighted users. - Example count: 4 - Example registry names: tooltip-demo, tooltip-grouped, tooltip-icon-row, tooltip-keyboard-hints # Documentation content # Accessibility (/docs/accessibility) Accessibility is part of the component structure, not a final polish step. LoveUI uses native HTML whenever possible. For complex interactions such as dialogs, menus, popovers, comboboxes, and tabs, LoveUI uses accessible primitives so keyboard navigation, focus handling, and ARIA state can be handled consistently. ## What LoveUI provides [#what-loveui-provides] LoveUI components are designed to support: * Keyboard navigation. * Visible focus states. * Labels and descriptions for form controls. * Screen-reader-friendly structure. * Disabled and invalid states. * Dialog and popup focus management. * Semantic HTML for common content. Some components still require correct app-level usage. For example, an input needs a useful label, a destructive button needs clear copy, and a toast should not contain critical information that disappears before the user can act. ## Labels and descriptions [#labels-and-descriptions] Every form control should have a label. Use [Field](/docs/components/field) when you need a label, description, validation message, and consistent spacing around a control. Good labels are short and specific: * Use `Email address` instead of `Email`. * Use `Project visibility` instead of `Visibility`. * Use `Receive product updates` instead of `Updates`. Descriptions should explain constraints, not repeat the label. ## Keyboard behavior [#keyboard-behavior] Interactive components should be usable without a mouse. Check these basics when you customize a component: * `Tab` reaches the control in a logical order. * `Enter` and `Space` activate buttons, checkboxes, switches, and toggles. * Arrow keys move through menus, radio groups, tabs, sliders, and list-based controls when expected. * `Escape` closes dialogs, menus, popovers, and sheets when the primitive supports it. * Focus returns to the trigger after a popup closes. ## Focus styles [#focus-styles] Do not remove focus styles. If you change the visual design, keep a clear focus ring or focus outline with enough contrast. Focus should be visible on buttons, links, inputs, menu items, tab triggers, and any custom interactive element. ## Disabled and loading states [#disabled-and-loading-states] Use disabled states only when the user cannot interact with the control. If the action is temporarily unavailable, explain why nearby. If the action is waiting for a request to finish, prefer a loading state that keeps the layout stable. ## Validation [#validation] Validation messages should be plain and specific. Use [Field](/docs/components/field) and [Form](/docs/components/form) to keep labels, descriptions, errors, and submission behavior connected. Write errors like: * `Enter a valid email address.` * `Choose at least one role.` * `Password must be at least 12 characters.` Avoid vague errors like `Invalid`, `Required`, or `Something went wrong` when the fix is known. # Component Guide (/docs/component-guide) LoveUI component pages follow the same structure so you can move quickly. Each page explains what the component is for, how to install it, how to import it, and which examples show the important states. ## Page structure [#page-structure] Most component pages include: * **Preview:** a live example of the default component. * **Installation:** CLI and manual setup. * **Usage:** the smallest useful code example. * **Anatomy:** the component parts and how they work together. * **Examples:** variants, sizes, states, form usage, and composition patterns. * **Accessibility notes:** keyboard, labels, focus, and screen-reader expectations. If a component is built on Base UI, the page may link to the Base UI API reference for lower-level behavior and props. ## Choosing a component [#choosing-a-component] Use the component that matches the user's task: * Use **Button** for actions. * Use **Link-style Button** only when the action is navigation. * Use **Checkbox** for independent yes/no choices. * Use **Radio Group** when only one option can be selected. * Use **Select** when the user chooses from a known list. * Use **Combobox** or **Autocomplete** when search helps the user find an option. * Use **Dialog** for focused work that interrupts the page. * Use **Sheet** for side panels, details, and secondary workflows. * Use **Toast** for short feedback that does not need a response. * Use **Alert Dialog** when the user must make a decision before continuing. ## Copying examples [#copying-examples] Examples are not only visual demos. They show recommended structure. When you copy an example: 1. Keep the accessibility parts, such as labels, descriptions, and triggers. 2. Replace placeholder text with real product copy. 3. Keep disabled, loading, and error states if the workflow can reach those states. 4. Update imports to match your project. 5. Test with keyboard navigation. ## Building larger screens [#building-larger-screens] Combine components by responsibility: * Use **Field** around form controls so labels and errors stay consistent. * Use **Card** or **Frame** to group related content. * Use **Tabs** when related views share the same page context. * Use **Menu** for compact command lists. * Use **Toolbar** when controls act on the same surface. * Use **Empty** when a section has no data yet. Start with the smallest component that solves the interaction. Add more structure only when the user needs it. ## Customizing components [#customizing-components] LoveUI components are meant to be edited. Common customizations include: * Changing class names. * Adjusting color variables. * Adding variants. * Replacing icons. * Renaming files or import paths. * Wrapping a component in your app-specific API. Keep behavior and accessibility intact when customizing. Style changes are usually safe. Changes to focus management, keyboard navigation, roles, labels, and portals need more care. # Contributing Guide (/docs/contributing) Thank you for helping improve LoveUI. The best contributions are focused, easy to review, and clear about the user problem they solve. ## What you can contribute [#what-you-can-contribute] You can help by: * Fixing bugs. * Improving docs. * Adding new UI components. * Adding examples. * Improving accessibility. ## Before you start [#before-you-start] Open an issue or discussion for large changes. Small fixes, docs edits, and example improvements can usually go straight to a pull request. Good first changes include: * Fixing unclear docs. * Adding a missing example state. * Improving labels or keyboard behavior. * Cleaning up a component prop or class name. * Fixing a bug with a small reproduction. ## Quick steps [#quick-steps] 1. Fork the repo and clone it. 2. Create a new branch. 3. Make a small, focused change. 4. Run formatting and build checks. 5. Open a pull request with a clear description. ## Commands to run before you open a PR [#commands-to-run-before-you-open-a-pr] ```bash bun run format:write bun run registry:build ``` If you changed core UI components, also run: ```bash bun run ui:propagate ``` If you changed docs, check that the docs site still builds and the changed pages render correctly. ## Write clear pull requests [#write-clear-pull-requests] Please include: * What changed. * Why you changed it. * Screenshots if UI changed. * Any breaking changes. * The checks you ran. Small pull requests are easier to review and merge quickly. ## Component contribution checklist [#component-contribution-checklist] When adding or changing a component, check: * The default example is useful. * Important states are documented. * The component works with keyboard navigation. * Labels, descriptions, and errors are connected where needed. * The manual installation block lists required dependencies and CSS variables. * The component source and examples use the same import style as the rest of the registry. ## Docs contribution checklist [#docs-contribution-checklist] When changing docs, use simple language. Prefer short paragraphs and specific examples. Explain when to use a component, when not to use it, and what each example demonstrates. ## Need more details? [#need-more-details] For the full technical process, file conventions, and registry details, see: [Full CONTRIBUTING.md](/api/raw/CONTRIBUTING.md) # Get Started (/docs/get-started) This guide shows the fastest path to using LoveUI in a React project. LoveUI components are meant to live in your app. The CLI copies component code, installs required dependencies, and leaves you with files you can edit. ## Project checklist [#project-checklist] Before adding components, make sure your project has: * React. * Tailwind CSS v4. * A global stylesheet, such as `app/globals.css`. * A component import alias, such as `@/components/ui`. If your app does not use the same import alias, you can still use LoveUI. Update the import paths after copying a component. ## Install the base setup [#install-the-base-setup] Run the CLI from your project root: ```bash npx love-ui@latest add loveui ``` This installs the shared setup that most components expect. It may add CSS variables, utility helpers, and dependencies used by LoveUI components. After installation, check the changed files before committing. The generated files are normal project files, so you can edit them. ## Add a component [#add-a-component] Add components one at a time: ```bash npx love-ui@latest add button ``` Replace `button` with the component name from the docs. For example, use `dialog`, `select`, `tabs`, or `toast`. Each component page also includes a CLI command with the exact name to install. ## Install manually [#install-manually] Manual setup is useful when you want to review every line before it enters your project. 1. Open a component page in the docs. 2. Copy the code from the **Code** tab. 3. Paste it into your project. 4. Install any listed dependencies. 5. Copy any required CSS variables. 6. Update import paths to match your app. Use [Styling](/docs/styling) when a component relies on shared colors or state tokens. ## Choose your first components [#choose-your-first-components] For a basic product screen, start with: * [Button](/docs/components/button) for actions. * [Input](/docs/components/input) and [Field](/docs/components/field) for forms. * [Dialog](/docs/components/dialog) for focused tasks. * [Table](/docs/components/table) for structured data. * [Toast](/docs/components/toast) for short feedback. For a complete form, combine [Form](/docs/components/form), [Field](/docs/components/field), and the specific controls you need. ## After setup [#after-setup] Read [Component Guide](/docs/component-guide) to understand how the component docs are organized. Read [Accessibility](/docs/accessibility) before changing keyboard behavior, focus styles, labels, or validation messages. If you want to contribute back to LoveUI, read the [Contributing Guide](/docs/contributing). # Introduction (/docs) ## What is LoveUI? [#what-is-loveui] **LoveUI** is an open-source set of React components, examples, and patterns. The components are built for product interfaces. They cover common controls like buttons, forms, dialogs, menus, tabs, tables, and feedback messages. Each component is designed to be copied into your app, adjusted, and owned by your codebase. LoveUI is not a black-box component package. You can inspect the source, change the styles, and keep only the pieces you need. ## What you get [#what-you-get] LoveUI includes: * **Components** for common interface needs. * **Examples** that show realistic states, sizes, variants, and form usage. * **Styling tokens** based on CSS variables and Tailwind CSS. * **Accessibility structure** from native HTML and Base UI where interaction behavior is needed. * **Installation paths** for both the CLI and manual copy-paste setup. ## Why LoveUI? [#why-loveui] Many UI kits only give you a visual shell. LoveUI gives you the structure, behavior, and examples needed to build real screens faster. The goal is simple: start with good defaults, then customize without fighting the library. LoveUI works well when you want: * Components that are easy to read. * Styling that lives in your app. * Examples that show the edge cases, not just the happy path. * A design system you can grow over time. ## How to use these docs [#how-to-use-these-docs] Start with [Get Started](/docs/get-started) to install the base setup. Then read [Component Guide](/docs/component-guide) to understand how component pages are structured. Each component page includes: * A live preview. * Installation steps. * Basic usage. * Notes about structure and behavior. * Examples for sizes, states, variants, and form integration. When you copy a component, also check its examples. They often show the small decisions that matter in production, such as disabled states, validation messages, grouped options, or keyboard-friendly composition. ## Design principles [#design-principles] LoveUI follows a few steady rules: * **Use clear HTML first.** Native elements are preferred when they solve the job. * **Compose small parts.** Components expose pieces like header, title, content, trigger, and footer when that makes the UI easier to control. * **Keep styles close.** Components use class names and CSS variables so you can tune them in your app. * **Respect accessibility.** Interactive components include keyboard and focus behavior where the underlying primitive supports it. * **Show real states.** Docs include loading, disabled, destructive, success, error, and empty states where they apply. ## Who should use it? [#who-should-use-it] LoveUI is useful for: * Product teams building dashboards, SaaS apps, admin tools, and internal tools. * Developers who want components they can copy and understand. * Teams building a shared design system on top of React and Tailwind CSS. * Projects that need accessible interaction patterns without a heavy abstraction layer. ## Open Source and Community [#open-source-and-community] LoveUI is open source under the **MIT license**. You can read the code, use it in your projects, and contribute improvements. Read the [Contributing Guide](/docs/contributing) to learn how to file issues, improve docs, or open a pull request. We welcome focused bug fixes, clearer examples, accessibility improvements, and new components that fit the system. # Styling (/docs/styling) ## Overview [#overview] LoveUI uses CSS variables for colors and Tailwind CSS for component classes. CSS variables make the components easier to theme because the same token can be reused across buttons, alerts, badges, forms, popovers, and dark mode. You can use the default palette, replace values with your own brand colors, or add more tokens for your app. ## How styling works [#how-styling-works] The default components use semantic variables instead of hard-coded colors. For example: * `--background` controls the app background. * `--foreground` controls default text. * `--card` and `--card-foreground` control card surfaces. * `--border` controls borders. * `--ring` controls focus rings. * `--success`, `--warning`, `--info`, and `--destructive` control state UI. This keeps the component code readable. A button can use `bg-primary` instead of a fixed color value. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add colors-zinc ``` This adds the default color variables. Copy these variables into your global stylesheet (for example `app/globals.css`): ```css title="app/globals.css" @theme inline { --color-destructive-foreground: var(--destructive-foreground); --color-info: var(--info); --color-info-foreground: var(--info-foreground); --color-success: var(--success); --color-success-foreground: var(--success-foreground); --color-warning: var(--warning); --color-warning-foreground: var(--warning-foreground); } :root { --background: oklch(1 0 0); --foreground: oklch(0.21 0.006 285.885); --card: oklch(1 0 0); --card-foreground: oklch(0.21 0.006 285.885); --popover: oklch(1 0 0); --popover-foreground: oklch(0.21 0.006 285.885); --primary: oklch(0.274 0.006 286.033); --primary-foreground: oklch(0.985 0 0); --secondary: oklch(0 0 0 / 4%); --secondary-foreground: oklch(0.21 0.006 285.885); --muted: oklch(0 0 0 / 4%); --muted-foreground: oklch(0.442 0.017 285.786); --accent: oklch(0 0 0 / 4%); --accent-foreground: oklch(0.21 0.006 285.885); --destructive: oklch(0.637 0.237 25.331); --destructive-foreground: oklch(0.505 0.213 27.518); --info: oklch(0.623 0.214 259.815); --info-foreground: oklch(0.488 0.243 264.376); --success: oklch(0.696 0.17 162.48); --success-foreground: oklch(0.508 0.118 165.612); --warning: oklch(0.769 0.188 70.08); --warning-foreground: oklch(0.555 0.163 48.998); --border: oklch(0 0 0 / 10%); --input: oklch(0 0 0 / 10%); --ring: oklch(0.705 0.015 286.067); } .dark { --background: oklch(0.141 0.005 285.823); --foreground: oklch(0.967 0.001 286.375); --card: color-mix( in srgb, oklch(0.21 0.006 285.885) 80%, oklch(0.141 0.005 285.823) ); --card-foreground: oklch(0.967 0.001 286.375); --popover: oklch(0.21 0.006 285.885); --popover-foreground: oklch(0.967 0.001 286.375); --primary: oklch(0.967 0.001 286.375); --primary-foreground: oklch(0.21 0.006 285.885); --secondary: oklch(1 0 0 / 8%); --secondary-foreground: oklch(0.967 0.001 286.375); --muted: oklch(1 0 0 / 8%); --muted-foreground: oklch(0.705 0.015 286.067); --accent: oklch(1 0 0 / 8%); --accent-foreground: oklch(0.967 0.001 286.375); --destructive: oklch(0.637 0.237 25.331); --destructive-foreground: oklch(0.704 0.191 22.216); --info: oklch(0.623 0.214 259.815); --info-foreground: oklch(0.707 0.165 254.624); --success: oklch(0.696 0.17 162.48); --success-foreground: oklch(0.765 0.177 163.223); --warning: oklch(0.769 0.188 70.08); --warning-foreground: oklch(0.828 0.189 84.429); --border: oklch(1 0 0 / 12%); --input: oklch(1 0 0 / 12%); --ring: oklch(0.552 0.016 285.938); } ``` ## Extended Color Variables [#extended-color-variables] LoveUI adds extra variables for state-based UI such as alerts, badges, validation, and status messages: * `--destructive-foreground`: Foreground color for destructive actions * `--info`: Information state color * `--info-foreground`: Foreground color for information states * `--success`: Success state color * `--success-foreground`: Foreground color for success states * `--warning`: Warning state color * `--warning-foreground`: Foreground color for warning states If you install with CLI, these are added automatically. ## Customizing the theme [#customizing-the-theme] To customize LoveUI, change the values in `:root` and `.dark`. Keep the token names stable when possible. Components expect those names, and changing only the values lets every component update together. When changing colors, check: * Text contrast on light and dark backgrounds. * Focus ring visibility. * Disabled state visibility. * Alert and badge readability. * Destructive action clarity. ## Adding component-specific styles [#adding-component-specific-styles] For one-off changes, update the class names in the copied component file. For reusable changes, add or adjust variants in the component. This is useful for buttons, badges, cards, alerts, and other components that need a small set of approved styles. Avoid hiding important state with only color. Pair color with text, icons, or labels when the state matters. # Accordion (/docs/components/accordion) ## Overview [#overview] Use an accordion when the page has related sections that should stay close together, but the user does not need to see every section at the same time. Accordions work well for settings, FAQs, filters, details panels, and long forms with optional sections. Avoid them when all content must be compared side by side. ## Anatomy [#anatomy] An accordion is made from an accordion root, one or more items, a trigger for each item, and content for each panel. The trigger should clearly describe what will open. The content should be short enough that opening one panel does not make the page hard to scan. ## Behavior [#behavior] Use a single accordion when only one panel should be open. Use a multiple accordion when several panels can stay open at once. Use controlled state when the open panel needs to sync with routing, saved preferences, or another part of the page. ## Accessibility [#accessibility] Keep triggers as real buttons, use clear headings, and make sure focus remains visible. Keyboard users should be able to tab to the trigger and open or close it with the keyboard. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add accordion ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, } from "@/components/ui/accordion" ``` ```tsx Is it accessible? Yes. It adheres to the WAI-ARIA design pattern. ``` ## Examples [#examples] These examples show the main accordion modes: one open panel, many open panels, and externally controlled state. ### Single Accordion [#single-accordion] Use this for compact pages where opening one section should close the previous section. ### Multiple Accordion [#multiple-accordion] Use this when each section is independent and users may need to keep several answers open. ### Controlled Accordion [#controlled-accordion] Use this when the open item must be controlled by your application state. # Alert (/docs/components/alert) ## Overview [#overview] Use an alert to call attention to information that affects the current page or task. Alerts are best for inline feedback, warnings, success messages, errors, and important context. They should be visible near the content they explain. Use a toast instead when the message is temporary and does not need to stay on the page. Use Alert Dialog when the user must make a decision before the app can continue. Alert dialogs are for high-impact choices such as deleting data, leaving with unsaved changes, confirming a destructive action, or acknowledging a blocking error. ## Anatomy [#anatomy] An alert usually has a container, optional icon, title, description, and optional actions. The title should be short. The description should explain what happened or what the user should do next. An alert dialog has a trigger, popup, title, description, and actions. The title should state the decision. The description should explain the consequence. The actions should make the safe choice and the risky choice easy to distinguish. ## Variants [#variants] Choose the variant by meaning, not by color preference. Use info for neutral guidance, success for completed work, warning for possible risk, error for a failed action, and destructive when the user is dealing with a harmful or irreversible action. ## Behavior [#behavior] Keep alerts close to the content they explain. Keep alert dialogs short and focused. If a flow needs a form, browsing, or several steps, use Dialog or Sheet instead. ## Accessibility [#accessibility] Do not rely on color alone. Pair state colors with clear text and, when useful, an icon. Keep action buttons keyboard reachable and avoid putting long instructions inside a small alert. Alert dialogs should have a clear title and description. Keep focus inside the popup while it is open. Make sure the cancel action is easy to reach and that destructive actions use explicit copy such as `Delete project`, not vague copy like `OK`. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add alert ``` Import the following variables into your CSS file ```css @theme inline { --color-destructive-foreground: var(--destructive-foreground); --color-info: var(--info); --color-info-foreground: var(--info-foreground); --color-success: var(--success); --color-success-foreground: var(--success-foreground); --color-warning: var(--warning); --color-warning-foreground: var(--warning-foreground); } :root { --destructive-foreground: oklch(0.704 0.191 22.216); --info: oklch(0.623 0.214 259.815); --info-foreground: oklch(0.707 0.165 254.624); --success: oklch(0.696 0.17 162.48); --success-foreground: oklch(0.765 0.177 163.223); --warning: oklch(0.769 0.188 70.08); --warning-foreground: oklch(0.828 0.189 84.429); } .dark { --destructive-foreground: oklch(0.704 0.191 22.216); --info: oklch(0.623 0.214 259.815); --info-foreground: oklch(0.707 0.165 254.624); --success: oklch(0.696 0.17 162.48); --success-foreground: oklch(0.765 0.177 163.223); --warning: oklch(0.769 0.188 70.08); --warning-foreground: oklch(0.828 0.189 84.429); } ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Alert, AlertDescription, AlertDialog, AlertDialogClose, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPopup, AlertDialogTitle, AlertDialogTrigger, AlertTitle, } from "@/components/ui/alert" ``` ```tsx Heads up! You can add components and dependencies to your app using the cli. ``` ```tsx Delete Account Are you absolutely sure? This action cannot be undone. This will permanently delete your account and remove your data from our servers. Cancel Delete Account ``` ## Examples [#examples] The examples show alerts with icons, actions, and common state variants. ### With Icon [#with-icon] Use an icon to make the alert easier to scan, especially in dense forms or settings pages. ### With Icon and Action Buttons [#with-icon-and-action-buttons] Use actions when the alert can be resolved or explored from the same place. ### Info Alert [#info-alert] Use info for neutral context or guidance. ### Success Alert [#success-alert] Use success when an action completed and the result should remain visible. ### Warning Alert [#warning-alert] Use warning when the user can continue but should understand a risk. ### Error Alert [#error-alert] Use error when something failed and the user needs to correct it. ## Alert Dialog [#alert-dialog] Alert Dialog is included in the same component file. Use it only when the user must respond before continuing. ### Basic Alert Dialog [#basic-alert-dialog] Use this pattern before a destructive or high-impact action. ### Close Confirmation [#close-confirmation] Use this pattern when closing would discard work, interrupt a process, or hide important state. # Autocomplete (/docs/components/autocomplete) ## Overview [#overview] Use autocomplete when users type into an input and need suggestions from a list. Autocomplete is useful for search, people pickers, command-style inputs, tags, addresses, and large option sets. It keeps typing as the main action while making valid choices easier to find. ## Anatomy [#anatomy] Autocomplete includes an input, popup, list, items, and optional clear or trigger controls. The input owns the typed value. The popup shows matching suggestions. Each item should have clear display text and a stable value. ## Behavior [#behavior] Use local filtering for small lists. Use async search for remote data. Add a limit when the full list is large. Auto-highlight can speed up keyboard selection, but it should not surprise users by choosing an item before they confirm. ## Accessibility [#accessibility] Provide a label through Field or another visible label. Keep keyboard navigation intact, including arrow keys, Enter, Escape, and focus return. Make empty and loading states clear when suggestions come from a server. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add autocomplete ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Autocomplete, AutocompleteEmpty, AutocompleteInput, AutocompleteItem, AutocompleteList, AutocompletePopup, } from "@/components/ui/autocomplete" ``` ```tsx const items = [ { value: "apple", label: "Apple" }, { value: "banana", label: "Banana" }, { value: "orange", label: "Orange" }, { value: "grape", label: "Grape" }, ] No results found. {(item) => {item.label}} ``` ## API Reference [#api-reference] The `AutocompleteInput` component extends the original Base UI component with a few extra props: | Prop | Type | Default | Description | | ------------- | --------------------------- | ----------- | ------------------------------------------------------------------------------------------------ | | `size` | `"sm" \| "default" \| "lg"` | `"default"` | The size variant of the input field. | | `showTrigger` | `boolean` | `false` | Whether to display a trigger button (chevron icon) on the right side of the input. | | `showClear` | `boolean` | `false` | Whether to display a clear button (X icon) on the right side of the input when there is a value. | ## Examples [#examples] These examples show disabled, sized, labeled, grouped, limited, async, and form-connected autocomplete patterns. ### Disabled [#disabled] Use disabled when the user cannot search or choose yet. ### Small Size [#small-size] Use the small size in compact toolbars, filters, or dense forms. ### Large Size [#large-size] Use the large size when the input is a primary search or selection control. ### With Label [#with-label] Use a label whenever the autocomplete appears in a form or settings area. ### Inline Autocomplete [#inline-autocomplete] Autofill the input with the highlighted item while navigating with arrow keys. ### Auto Highlight [#auto-highlight] Automatically highlight the first matching option. ### With Clear Button [#with-clear-button] Use a clear button when users often need to reset the value. ### With Trigger and Clear Buttons [#with-trigger-and-clear-buttons] Use a trigger button when users may want to browse options without typing. ### With Groups [#with-groups] Use groups when suggestions have meaningful categories. ### With Limit Results [#with-limit-results] Limit results to keep the popup quick to scan. ### Async Search [#async-search] Use async search when suggestions come from an API or remote index. ### Form Integration [#form-integration] Use form integration when the selected value must be validated and submitted. # Avatar (/docs/components/avatar) ## Overview [#overview] Use an avatar to represent a person, team, account, or organization. Avatars work best when they support identity, not when they carry critical information by themselves. Always pair them with names in places where identity must be unambiguous. ## Anatomy [#anatomy] An avatar has an image and a fallback. The image is shown when it loads successfully. The fallback is shown when there is no image or the image fails to load. ## Usage guidance [#usage-guidance] Use initials, an icon, or a neutral placeholder as the fallback. Keep avatar sizes consistent in the same surface. Use grouped avatars when showing a small set of collaborators or participants. ## Accessibility [#accessibility] Use meaningful alt text when the avatar image adds identity. Use empty alt text when the visible name already identifies the person next to the image. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add avatar ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" ``` ```tsx CL ``` ## Examples [#examples] The examples show image fallback, size, radius, and grouped avatar patterns. ### Fallback Only [#fallback-only] ### Different Sizes [#different-sizes] ### Different Radius [#different-radius] ### Group Avatars [#group-avatars] # Badge (/docs/components/badge) ## Overview [#overview] Use a badge to display a short label, status, count, category, or metadata. Badges should be compact and easy to scan. They are useful in tables, cards, headers, filters, and lists. Do not use a badge for long messages or primary actions. ## Anatomy [#anatomy] A badge is usually a small inline container with text and optional icon. It can also render another element, such as a link, when the badge needs to be interactive. ## Variants [#variants] Choose the variant by meaning. Outline is neutral, secondary is low emphasis, destructive is for dangerous state, and state variants such as info, success, warning, and error should match the status being shown. ## Accessibility [#accessibility] Use readable text, not color alone. If a badge is a link, make sure the destination is clear from the visible text or surrounding context. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add badge ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Import the following variables into your CSS file ```css @theme inline { --color-destructive-foreground: var(--destructive-foreground); --color-info: var(--info); --color-info-foreground: var(--info-foreground); --color-success: var(--success); --color-success-foreground: var(--success-foreground); --color-warning: var(--warning); --color-warning-foreground: var(--warning-foreground); } :root { --destructive-foreground: oklch(0.505 0.213 27.518); --info: oklch(0.623 0.214 259.815); --info-foreground: oklch(0.488 0.243 264.376); --success: oklch(0.696 0.17 162.48); --success-foreground: oklch(0.508 0.118 165.612); --warning: oklch(0.769 0.188 70.08); --warning-foreground: oklch(0.555 0.163 48.998); } .dark { --destructive-foreground: oklch(0.704 0.191 22.216); --info: oklch(0.623 0.214 259.815); --info-foreground: oklch(0.707 0.165 254.624); --success: oklch(0.696 0.17 162.48); --success-foreground: oklch(0.765 0.177 163.223); --warning: oklch(0.769 0.188 70.08); --warning-foreground: oklch(0.828 0.189 84.429); } ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Badge } from "@/components/ui/badge" ``` ```tsx Badge ``` ## Link [#link] You can use the [`render`](https://base-ui.com/react/utils/use-render#migrating-from-radix-ui) prop to make another component look like a badge. Here's an example of a link that looks like a badge. ```tsx import Link from "next/link" import { Badge } from "@/components/ui/badge" export function LinkAsBadge() { return }>New } ``` ## Examples [#examples] The examples show visual variants, sizes, icon support, and link rendering. ### Outline [#outline] ### Secondary [#secondary] ### Destructive [#destructive] ### Info [#info] ### Success [#success] ### Warning [#warning] ### Error [#error] ### Small [#small] ### Large [#large] ### With Icon [#with-icon] ### With Link [#with-link] # Breadcrumb (/docs/components/breadcrumb) ## Overview [#overview] Use breadcrumbs to show where the current page sits in a hierarchy. Breadcrumbs work best for nested products, documentation, settings, folders, and admin sections. They should not replace the main navigation. They help users understand context and move up one or more levels. ## Anatomy [#anatomy] A breadcrumb has a list, items, links, separators, and a current page item. Earlier items are usually links. The current item usually is not a link. ## Usage guidance [#usage-guidance] Keep labels short. Start with the highest useful parent, not always the site root. Use custom separators only when they still read clearly between items. ## Accessibility [#accessibility] Wrap breadcrumbs in navigation with a clear label. Mark the current page so assistive technology can distinguish it from links. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add breadcrumb ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/components/ui/breadcrumb" ``` ```tsx Home Components Breadcrumb ``` ## Examples [#examples] The example shows how to change the separator while keeping the same hierarchy. ### With custom separator [#with-custom-separator] # Button (/docs/components/button) ## Overview [#overview] Use a button for actions. A button should do something on the current page, submit a form, open a menu, start a task, or confirm a choice. Use a link when the user is navigating to another page. If a link must look like a button, render the link through the button component so the visual style is shared while the semantics stay correct. ## Anatomy [#anatomy] A button has a visible label, optional icon, variant, size, and state. The label should describe the action directly. Prefer `Save changes`, `Invite member`, or `Delete project` over vague labels like `Submit` or `Continue` when the result is specific. ## Variants [#variants] Use the default variant for primary actions, secondary for supporting actions, outline for medium emphasis, ghost for low emphasis, link for inline actions, and destructive for dangerous actions. ## Accessibility [#accessibility] Buttons must have accessible names. Icon-only buttons need a label through text, `aria-label`, or an equivalent pattern. Keep disabled and loading states clear so users understand why the action is unavailable. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add button ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Import the following variables into your CSS file ```css @theme inline { --color-destructive-foreground: var(--destructive-foreground); } :root { --destructive-foreground: oklch(0.505 0.213 27.518); } .dark { --destructive-foreground: oklch(0.704 0.191 22.216); } ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Button } from "@/components/ui/button" ``` ```tsx ``` ## Link [#link] You can use the [`render`](https://base-ui.com/react/utils/use-render#migrating-from-radix-ui) prop to make another component look like a button. Here's an example of a link that looks like a button. ```tsx import Link from "next/link" import { Button } from "@/components/ui/button" export function LinkAsButton() { return } ``` ## Examples [#examples] The examples show variants, sizes, icon layouts, disabled state, link rendering, and loading behavior. ### Default [#default] ### Outline [#outline] ### Secondary [#secondary] ### Destructive [#destructive] ### Destructive Outline [#destructive-outline] ### Ghost [#ghost] ### Link [#link-1] ### Extra-small Size [#extra-small-size] ### Small Size [#small-size] ### Large Size [#large-size] ### Extra-large Size [#extra-large-size] ### Disabled [#disabled] ### Icon [#icon] ### Icon Small Size [#icon-small-size] ### Icon Large Size [#icon-large-size] ### With Icon [#with-icon] ### With Link [#with-link] ### Loading [#loading] # Card (/docs/components/card) ## Overview [#overview] Use a card to group related content and actions inside a clear surface. Cards work well for dashboards, settings groups, pricing items, summaries, and repeated list items. Avoid nesting cards inside cards unless each layer has a clear job. ## Anatomy [#anatomy] A card usually has a container, header, title, description, content, footer, and actions. Not every card needs every part. Keep the structure simple and make the most important information easy to scan first. ## Usage guidance [#usage-guidance] Use cards for repeated items or self-contained content groups. For broad page sections, prefer normal page layout instead of turning every section into a card. ## Accessibility [#accessibility] Use real headings when the card introduces a section. If the whole card is clickable, make the interactive target clear and preserve keyboard access. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add card ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Card, CardDescription, CardFooter, CardHeader, CardPanel, CardTitle, } from "@/components/ui/card" ``` ```tsx Title Description Content Footer ``` # Checkbox (/docs/components/checkbox) ## Overview [#overview] Use a checkbox when the user can turn an independent option on or off. Checkboxes are right for preferences, permissions, optional settings, and multi-select lists. Use a radio group when the user must choose exactly one option from a set. Use Checkbox Group when several checkboxes belong to the same question or setting. Groups are useful for permissions, filters, notification channels, roles, and feature selections where more than one option can be selected. ## Anatomy [#anatomy] A checkbox has an input, visual indicator, label, optional description, and state. The label should make sense when read on its own. A checkbox group provides shared state and contains individual checkbox items. It should have a group label or surrounding Fieldset so users understand what the choices are about. ## Behavior [#behavior] A checkbox can be checked, unchecked, disabled, or invalid. Some grouped checkbox patterns also use an indeterminate parent state to show that only some child items are selected. Use disabled items for options that are visible but unavailable. Use parent checkboxes when a group needs select-all behavior. Use nested parent checkboxes when choices are hierarchical. ## Accessibility [#accessibility] Always connect the checkbox to a label. Descriptions and errors should be associated through Field when the checkbox appears in a form. Group related checkboxes with a visible label. Make sure each checkbox has its own label and that parent states are understandable through text, not only the visual indeterminate mark. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add checkbox ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Checkbox, CheckboxGroup } from "@/components/ui/checkbox" ``` ```tsx ``` ```tsx ``` ## Examples [#examples] The examples show disabled, described, card-style, and form-connected checkboxes. For accessible labelling and validation, prefer using the `Field` component to wrap checkboxes. See the related example: [Checkbox field](/ui/docs/components/field#checkbox-field). ### Disabled [#disabled] ### With Description [#with-description] ### Card Style [#card-style] ### Form Integration [#form-integration] Field provides accessible labelling and validation primitives for form controls. Use it with `Form` to submit values. ## Checkbox Group [#checkbox-group] Checkbox Group is included in the same component file. Use it when several checkboxes answer the same question or share one submitted value. For accessible group labelling and validation, prefer wrapping checkbox groups with `Field` and `Fieldset`. See the related example: [Checkbox group field](/ui/docs/components/field#checkbox-group-field). ### Basic Group [#basic-group] ### With Disabled Item [#with-disabled-item] ### Parent Checkbox [#parent-checkbox] ### Nested Parent Checkbox [#nested-parent-checkbox] ### Group Form Integration [#group-form-integration] # Collapsible (/docs/components/collapsible) ## Overview [#overview] Use a collapsible when one piece of content can be shown or hidden by a single control. Collapsible is simpler than accordion. It is a good fit for optional details, advanced settings, helper text, or a single expandable section. ## Anatomy [#anatomy] A collapsible has a root, trigger, and content. The trigger controls whether the content is visible. The content should be directly related to the trigger. ## Behavior [#behavior] Use collapsible when there is only one expandable region. If you have several related expandable regions, use Accordion instead. ## Accessibility [#accessibility] The trigger should be a real button with clear text. Keep focus visible and make sure the expanded state is communicated by the primitive. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add collapsible ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Collapsible, CollapsiblePanel, CollapsibleTrigger, } from "@/components/ui/collapsible" ``` ```tsx Can I access the file in the cloud? Yes, you can access the file in the cloud. ``` # Combobox (/docs/components/combobox) ## Overview [#overview] Use a combobox when users choose one or more values from a list and search or filtering helps them find the right option. Combobox is useful for large lists, people pickers, labels, projects, countries, commands, and multi-select workflows. ## Anatomy [#anatomy] A combobox has a trigger or input, popup, list, items, and selection state. Single-selection comboboxes store one value. Multiple-selection comboboxes store a list of values. ## Behavior [#behavior] Use single selection when one value is allowed. Use multiple selection for tags, filters, permissions, or categories. Use clear buttons when users often reset the value. ## Accessibility [#accessibility] Give the combobox a label and keep keyboard navigation intact. Users should be able to open the popup, move through options, select items, clear values, and close the popup without a mouse. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add combobox ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ### Single Selection [#single-selection] ```tsx import { Combobox, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, ComboboxPopup, } from "@/components/ui/combobox" ``` ```tsx const items = [ { value: "apple", label: "Apple" }, { value: "banana", label: "Banana" }, { value: "orange", label: "Orange" }, { value: "grape", label: "Grape" }, ] No results found. {(item) => {item.label}} ``` ### Multiple Selection [#multiple-selection] ```tsx import { Combobox, ComboboxChip, ComboboxChips, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, ComboboxPopup, ComboboxValue, } from "@/components/ui/combobox" ``` ```tsx const items = [ { value: "apple", label: "Apple" }, { value: "banana", label: "Banana" }, { value: "orange", label: "Orange" }, { value: "grape", label: "Grape" }, ] {(value: { value: string; label: string }[]) => ( <> {value?.map((item) => ( {item.label} ))} 0 ? undefined : "Select a Select an item..."} aria-label="Select an item" /> )} No results found. {(item) => {item.label}} ``` ## API Reference [#api-reference] The `ComboboxInput` component extends the original Base UI component with a few extra props: | Prop | Type | Default | Description | | ------------- | --------------------------- | ----------- | ------------------------------------------------------------------------------------------------ | | `size` | `"sm" \| "default" \| "lg"` | `"default"` | The size variant of the input field. | | `showTrigger` | `boolean` | `true` | Whether to display a trigger button (chevron icon) on the right side of the input. | | `showClear` | `boolean` | `false` | Whether to display a clear button (X icon) on the right side of the input when there is a value. | ## Examples [#examples] The examples show disabled, sized, labeled, grouped, single-selection, multiple-selection, input-in-popup, and form-connected comboboxes. ### Disabled [#disabled] ### Small Size [#small-size] ### Large Size [#large-size] ### With Label [#with-label] ### Auto Highlight [#auto-highlight] Automatically highlight the first matching option. ### With Clear Button [#with-clear-button] ### With Groups [#with-groups] ### With Multiple Selection [#with-multiple-selection] ### With Input Inside Popup [#with-input-inside-popup] ### Form Integration [#form-integration] ### Form Integration - Multiple [#form-integration---multiple] # Dialog (/docs/components/dialog) ## Overview [#overview] Use a dialog when the user needs to focus on a task without leaving the current page. Dialogs are good for forms, confirmations, detail views, short workflows, and focused editing. Avoid dialogs for large multi-step experiences that need a full page. ## Anatomy [#anatomy] A dialog has a trigger, popup, header, title, description, content, footer, and close action. The title should explain the task. The footer usually contains the main action and a cancel or close action. ## Behavior [#behavior] Dialogs open above the page and should keep focus inside while open. Use nested dialogs only when the second dialog is a true interruption, such as confirming a close action. ## Accessibility [#accessibility] Always provide a title. Add a description when the task needs context. Make sure destructive actions are explicit and that focus returns to the trigger when the dialog closes. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add dialog ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Dialog, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogTitle, DialogTrigger, } from "@/components/ui/dialog" ``` ```tsx Open Dialog Dialog Title Dialog Description Close ``` ## Examples [#examples] The examples show opening from a menu, nesting, and confirming close actions. ### Open from a Menu [#open-from-a-menu] ### Nested Dialogs [#nested-dialogs] ### Close Confirmation [#close-confirmation] # Empty (/docs/components/empty) ## Overview [#overview] Use Empty when a section has no content to show yet. Empty states should explain what is missing and give the user a useful next action. They are common in dashboards, tables, lists, search results, inboxes, and setup flows. ## Anatomy [#anatomy] An empty state can include media, a title, description, content, and actions. Keep the title short and use the description to explain why the state exists or how to move forward. ## Usage guidance [#usage-guidance] Write empty states for the real cause. `No projects yet` is better than `Nothing here`. Add an action when the user can create, import, clear filters, or retry. ## Accessibility [#accessibility] Use normal headings and buttons. Do not rely on illustration alone to explain the state. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add empty ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, } from "@/components/ui/empty" ``` ```tsx No data No data found ``` ## API Reference [#api-reference] ### Empty [#empty] The main component of the empty state. Wraps the `EmptyHeader` and `EmptyContent` components. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | | ```tsx ``` ### EmptyHeader [#emptyheader] The `EmptyHeader` component wraps the empty media, title, and description. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | | ```tsx ``` ### EmptyMedia [#emptymedia] Use the `EmptyMedia` component to display the media of the empty state such as an icon or an image. You can also use it to display other components such as an avatar. | Prop | Type | Default | | ----------- | --------------------- | --------- | | `variant` | `"default" \| "icon"` | `default` | | `className` | `string` | | ```tsx ``` ```tsx CL ``` ### EmptyTitle [#emptytitle] Use the `EmptyTitle` component to display the title of the empty state. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | | ```tsx No data ``` ### EmptyDescription [#emptydescription] Use the `EmptyDescription` component to display the description of the empty state. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | | ```tsx You do not have any notifications. ``` ### EmptyContent [#emptycontent] Use the `EmptyContent` component to display the content of the empty state such as a button, input or a link. | Prop | Type | Default | | ----------- | -------- | ------- | | `className` | `string` | | ```tsx ``` # Field (/docs/components/field) ## Overview [#overview] Use Field to wrap a form control with a label, description, validation message, and disabled or invalid state. Field keeps form layout consistent and helps connect supporting text to the control. ## Anatomy [#anatomy] A field usually includes a label, control, description, and error message. The control can be an input, textarea, select, checkbox, radio group, slider, switch, combobox, or custom form element. ## Behavior [#behavior] Use required, disabled, invalid, and validity states to match the real form state. Keep validation messages close to the control they explain. ## Accessibility [#accessibility] Field is most useful when it connects labels, descriptions, and errors in a way screen readers can understand. Use clear labels and specific error messages. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add field ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Field, FieldControl, FieldDescription, FieldError, FieldLabel, FieldValidity, } from "@/components/ui/field" ``` ```tsx Name Visible on your profile Please enter a valid name {(validity) => ( {validity.error &&

{validity.error}

} )}
``` ## Examples [#examples] The examples show Field with required, disabled, error, validity, and many different form controls. ### Required Field [#required-field] ### Disabled Field [#disabled-field] ### With Error [#with-error] Enter an invalid email address and press enter to see the error. ### With Validity [#with-validity] ### Autocomplete Field [#autocomplete-field] ### Combobox Field [#combobox-field] ### Combobox Multiple Field [#combobox-multiple-field] ### Textarea Field [#textarea-field] ### Select Field [#select-field] ### Checkbox Field [#checkbox-field] ### Checkbox Group Field [#checkbox-group-field] ### Radio Group Field [#radio-group-field] ### Switch Field [#switch-field] ### Slider Field [#slider-field] ### Number Field [#number-field] ### Complete Form Example [#complete-form-example] # Fieldset (/docs/components/fieldset) ## Overview [#overview] Use Fieldset to group related form controls under one legend. Fieldset is useful for radio groups, checkbox groups, address sections, permission groups, and any form area where several inputs answer one larger question. ## Anatomy [#anatomy] A fieldset has a container, legend, optional description, and controls. The legend names the group. The controls inside should all relate to that group. ## Usage guidance [#usage-guidance] Use Field for one control. Use Fieldset for a set of related controls. Combine both when each control in the group also needs its own label, description, or error. ## Accessibility [#accessibility] The legend gives assistive technology context for the controls inside. Keep it visible and specific. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add fieldset ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Fieldset, FieldsetLegend } from "@/components/ui/fieldset" ``` ```tsx
Fieldset legend
``` # Form (/docs/components/form) ## Overview [#overview] Use Form to handle form submission, validation, and shared form state. Form is useful when multiple fields need to be submitted together or validated together. It works well with Field and the form examples across the docs. ## Anatomy [#anatomy] A form includes the form root, fields, controls, validation messages, and submit actions. Each field should have a label and a clear error message when validation fails. ## Behavior [#behavior] Keep submission state clear. Disable or show loading on the submit action while a request is running. Show errors near the fields that need attention. ## Accessibility [#accessibility] Use labels, descriptions, and errors consistently. Make sure keyboard users can reach every field and submit or cancel the form. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add form ``` Install the following dependencies: ```bash npm install @base-ui-components/react zod ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Field, FieldControl, FieldError, FieldLabel, } from "@/components/ui/field" import { Form } from "@/components/ui/form" ``` ```tsx
{ /* handle submit */ }} > Email Please enter a valid email.
``` ## Examples [#examples] The examples show basic form structure and schema validation with Zod. ### Using with Zod [#using-with-zod] # Frame (/docs/components/frame) ## Overview [#overview] Use Frame when you need a simple bordered surface around related content. Frame is lighter than Card. It works well for previews, examples, media, code-adjacent content, and small grouped regions that do not need card header or footer structure. ## Anatomy [#anatomy] A frame is mainly a container. It gives content a boundary without adding a full card layout. ## Usage guidance [#usage-guidance] Use Frame for visual grouping. Use Card when the content needs a title, description, content area, and actions. ## Accessibility [#accessibility] Frame does not add meaning by itself. Use headings, labels, and semantic HTML inside it when the grouped content needs structure. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add frame ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle, } from "@/components/ui/frame" ``` ```tsx Title Description Content Footer ``` # Group (/docs/components/group) ## Overview [#overview] Use Group to visually connect controls that work together. Group is useful for segmented inputs, attached buttons, search boxes with actions, and compact control sets. ## Anatomy [#anatomy] A group wraps multiple controls and adjusts their borders or radius so they read as one unit. ## Usage guidance [#usage-guidance] Use Group when controls are part of the same action. Do not group unrelated buttons just to save space. ## Accessibility [#accessibility] Grouped controls still need their own labels or accessible names. Keyboard order should follow the visual order. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add group ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Button } from "@/components/ui/button" import { Group, GroupItem, GroupSeparator } from "@/components/ui/group" ``` ```tsx }>Button }>Button ``` ## Examples [#examples] The example shows an input attached to an action. ### With Input [#with-input] # Input (/docs/components/input) ## Overview [#overview] Use Input for short free-form text, numbers, email addresses, URLs, search terms, and file selection. Input is a low-level control. In forms, wrap it with Field so users get a label, description, error, and disabled state in a consistent layout. ## Anatomy [#anatomy] An input has a value, placeholder, type, size, disabled state, and optional surrounding controls. The placeholder should never replace a real label. ## Usage guidance [#usage-guidance] Choose the native input type that matches the data. Use `email` for email, `search` for search, `file` for files, and so on. Use Textarea for longer multi-line text. ## Accessibility [#accessibility] Always provide a label. Use clear validation messages and keep focus styles visible. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add input ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Input } from "@/components/ui/input" ``` ```tsx ``` ## Examples [#examples] The examples show sizes, disabled state, file input, labels, attached buttons, and form usage. For accessible labelling and validation, prefer using the `Field` component to wrap inputs, or the `FieldControl` component. See some [related examples](/ui/docs/components/field). ### Small Size [#small-size] ### Large Size [#large-size] ### Disabled [#disabled] ### File [#file] ### With Label [#with-label] ### With Button [#with-button] ### Form Integration [#form-integration] # Label (/docs/components/label) ## Overview [#overview] Use Label to name a form control. Labels help every user understand what a control does. They are also required for good screen-reader and click-target behavior. ## Anatomy [#anatomy] A label is connected to a control. The visible text should be short, specific, and stable. ## Usage guidance [#usage-guidance] Use Field when you need a label plus description or validation. Use Label directly when you only need the label primitive. ## Accessibility [#accessibility] Do not replace labels with placeholders. A placeholder disappears when the user types and is not enough context for many users. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add label ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Label } from "@/components/ui/label" ``` ```tsx ``` ## Examples [#examples] The example shows Label connected to a checkbox. For accessible labelling and validation, prefer using the `FieldLabel` component. See some [related examples](/ui/docs/components/field). ### With Checkbox [#with-checkbox] # Menu (/docs/components/menu) ## Overview [#overview] Use Menu for a compact list of actions or choices opened from a trigger. Menus are useful for overflow actions, account menus, row actions, editor commands, and grouped command lists. Do not use a menu for primary navigation when links should stay visible. ## Anatomy [#anatomy] A menu has a trigger, popup, items, optional groups, labels, separators, checkbox items, radio items, links, and nested submenus. ## Behavior [#behavior] Keep menu labels short and action-oriented. Use nested menus sparingly because they require more pointer and keyboard precision. ## Accessibility [#accessibility] Menu items should be reachable with keyboard navigation. Use checkbox and radio menu items only when the checked state matters inside the menu. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add menu ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Import the following variables into your CSS file ```css @theme inline { --color-destructive-foreground: var(--destructive-foreground); } :root { --destructive-foreground: oklch(0.505 0.213 27.518); } .dark { --destructive-foreground: oklch(0.704 0.191 22.216); } ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Menu, MenuCheckboxItem, MenuGroup, MenuGroupLabel, MenuItem, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSub, MenuSubPopup, MenuSubTrigger, MenuTrigger, } from "@/components/ui/menu" ``` ```tsx Open Profile Playback Play Pause Shuffle Repeat Sort by Artist Album Title Add to playlist Jazz Rock ``` ## Examples [#examples] The examples show hover opening, checkbox items, radio groups, links, group labels, nesting, close behavior, and opening a dialog. ### Open on Hover [#open-on-hover] ### With Checkbox [#with-checkbox] ### With Radio Group [#with-radio-group] ### With Link [#with-link] ### With Group Label [#with-group-label] ### Nested Menu [#nested-menu] ### Close on Click [#close-on-click] ### Open a Dialog [#open-a-dialog] # Meter (/docs/components/meter) ## Overview [#overview] Use Meter to show a known numeric value within a known range. Meter is useful for storage usage, quota, health, score, strength, capacity, and other measured values. Use Progress instead when a task is actively moving toward completion. ## Anatomy [#anatomy] A meter has a value, minimum, maximum, optional label, optional formatted value, and visual bar. ## Usage guidance [#usage-guidance] Use a label and value when the number matters. Use range styling when different portions of the range have meaning, such as low, normal, and high. ## Accessibility [#accessibility] Expose the value in text when precision matters. Do not rely only on bar length or color. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add meter ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Meter, MeterLabel, MeterValue } from "@/components/ui/meter" ``` ```tsx Progress ``` ## Examples [#examples] The examples show a simple meter, formatted value, and range-based display. ### Without Label and Value [#without-label-and-value] ### With Formatted Value [#with-formatted-value] ### With Range [#with-range] # Number Field (/docs/components/number-field) ## Overview [#overview] Use Number Field when users need to enter or adjust a numeric value. Number Field is useful for quantities, limits, prices, percentages, durations, counts, and settings where incrementing or decrementing is helpful. ## Anatomy [#anatomy] A number field has an input, value, increment and decrement controls, optional scrub area, range constraints, step size, and formatted display. ## Behavior [#behavior] Set sensible minimum, maximum, and step values. Use formatting when the number represents currency, percent, units, or other structured values. ## Accessibility [#accessibility] Provide a label and make sure the increment and decrement controls have accessible names. Keep typed input available for keyboard users. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add number-field ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { NumberField, NumberFieldDecrement, NumberFieldGroup, NumberFieldIncrement, NumberFieldInput, NumberFieldScrubArea, } from "@/components/ui/number-field" ``` ```tsx ``` ## Examples [#examples] The examples show sizes, disabled state, external labels, scrub input, ranges, formatting, step values, and form integration. For accessible labelling and validation, prefer using the `Field` component to wrap number fields. See the related example: [Number field](/ui/docs/components/field#number-field). ### Small Size [#small-size] ### Large Size [#large-size] ### Disabled [#disabled] ### With External Label [#with-external-label] ### With Scrub [#with-scrub] ### With Range [#with-range] ### With Formatted Value [#with-formatted-value] ### With Step [#with-step] ### Form Integration [#form-integration] # Pagination (/docs/components/pagination) ## Overview [#overview] Use Pagination when a long list is split into pages. Pagination is useful for tables, search results, audit logs, directories, and other collections where showing every item at once would be slow or hard to scan. ## Anatomy [#anatomy] Pagination usually includes previous and next controls, page links, the current page, and sometimes skipped ranges. ## Usage guidance [#usage-guidance] Use pagination when pages are stable and users need direct access to specific positions. Use infinite loading only when browsing is more important than precise navigation. ## Accessibility [#accessibility] Use clear labels for previous and next controls. Mark the current page so screen readers can identify it. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add pagination ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, } from "@/components/ui/pagination" ``` ```tsx 1 ``` # Popover (/docs/components/popover) ## Overview [#overview] Use Popover for contextual content that appears near a trigger. Popovers are good for lightweight forms, explanations, filters, small pickers, and secondary controls. Use Dialog when the task needs focus trapping or a larger workflow. ## Anatomy [#anatomy] A popover has a trigger, popup, optional title or description, content, and optional close action. ## Behavior [#behavior] Keep popover content short and directly related to the trigger. Avoid putting complex multi-step workflows inside a popover. ## Accessibility [#accessibility] The trigger should clearly describe what opens. Make sure focus behavior is predictable and that users can dismiss the popover with keyboard controls. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add popover ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Popover, PopoverClose, PopoverDescription, PopoverPopup, PopoverTitle, PopoverTrigger, } from "@/components/ui/popover" ``` ```tsx Open Popover Popover Title Popover Description Close ``` ## Examples [#examples] The example shows a popover with an explicit close action. ### With Close Button [#with-close-button] # Preview Card (/docs/components/preview-card) ## Overview [#overview] Use Preview Card to show a small preview when a user hovers or focuses a link. Preview cards are useful for profiles, documents, issues, pages, and references where a quick summary helps users decide whether to open the link. ## Anatomy [#anatomy] A preview card has a trigger link and popup content. The popup usually includes a title, short description, metadata, and sometimes media. ## Usage guidance [#usage-guidance] Keep preview content brief. It should help users understand the destination, not replace the destination page. ## Accessibility [#accessibility] The link must still work without the preview. Do not put essential actions only inside hover-only content. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add preview-card ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Button } from "@/components/ui/button" import { PreviewCard, PreviewCardPopup, PreviewCardTrigger, } from "@/components/ui/preview-card" ``` ```tsx Open Preview Card Preview Card Content ``` # Progress (/docs/components/progress) ## Overview [#overview] Use Progress to show how far a task has advanced. Progress is useful for uploads, imports, onboarding steps, generation, installation, and long-running actions. Use Meter for static values like quota or capacity. ## Anatomy [#anatomy] A progress indicator has a value, maximum, optional label, optional formatted value, and visual bar. ## Behavior [#behavior] Use determinate progress when you know the percentage. Use a separate loading pattern when the duration is unknown. ## Accessibility [#accessibility] Show text when the value matters. Do not communicate progress only through animation or color. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add progress ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Progress, ProgressLabel, ProgressValue, } from "@/components/ui/progress" ``` ```tsx ``` Note: If you render children inside `Progress`, you must also include `ProgressTrack` and `ProgressIndicator` inside it. Without them, the bar will not display. When no children are provided, a default track and indicator are rendered for you. ## Examples [#examples] The examples show progress with labels and formatted values. ### With Label and Value [#with-label-and-value] ### With Formatted Value [#with-formatted-value] # Radio Group (/docs/components/radio-group) ## Overview [#overview] Use Radio Group when the user must choose one option from a set. Radio groups are useful for plans, visibility, shipping speed, sort order, and settings where choices are mutually exclusive. ## Anatomy [#anatomy] A radio group has a group label, radio items, item labels, optional descriptions, and selection state. ## Behavior [#behavior] Show all important options when the list is short. Use Select when the list is long or when space is limited. ## Accessibility [#accessibility] Group radio items with a clear label. Each item should have its own label, and keyboard users should be able to move through options with arrow keys. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add radio-group ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Label } from "@/components/ui/label" import { Radio, RadioGroup } from "@/components/ui/radio-group" ``` ```tsx ``` ## Examples [#examples] The examples show disabled, described, card-style, and form-connected radio groups. For accessible labelling and validation, prefer using the `Field` component to wrap radio buttons. See the related example: [Radio Group field](/ui/docs/components/field#radio-group-field). ### Disabled [#disabled] ### With Description [#with-description] ### Card Style [#card-style] ### Form Integration [#form-integration] # Scroll Area (/docs/components/scroll-area) ## Overview [#overview] Use Scroll Area when content needs its own scrollable region with custom scrollbars. Scroll areas are useful for menus, sidebars, code panes, tables, activity feeds, and fixed-height panels. ## Anatomy [#anatomy] A scroll area has a viewport, content, and optional horizontal or vertical scrollbars. ## Usage guidance [#usage-guidance] Use scroll areas when the surrounding layout needs to stay fixed. Avoid hiding important content in a small scroll region when the page itself can scroll naturally. ## Accessibility [#accessibility] Make sure keyboard and touch users can reach the content. Keep scrollable regions large enough to use comfortably. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add scroll-area ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { ScrollArea } from "@/components/ui/scroll-area" ``` ```tsx
Just as suddenly as it had begun, the sensation stopped, leaving Alice feeling slightly disoriented. She looked around and realized that the room hadn't changed at all - it was she who had grown smaller, shrinking down to a fraction of her previous size. Alice felt herself growing larger and larger, filling up the entire room until she feared she might burst. The sensation was both thrilling and terrifying, as if she were expanding beyond the confines of her own body. She wondered if this was what it felt like to be a balloon, swelling with air until it could hold no more.
``` ## Examples [#examples] The examples show horizontal scrolling and combined horizontal and vertical scrolling. ### Horizontal Scroll [#horizontal-scroll] ### Both Scrollbars [#both-scrollbars] # Select (/docs/components/select) ## Overview [#overview] Use Select when users choose from a predefined list. Select is best for known options such as status, role, country, visibility, sort order, and compact settings. Use Combobox when search is important. ## Anatomy [#anatomy] A select has a trigger, value display, popup, items, optional groups, and selection state. Multiple selection is available when the user can choose more than one item. ## Behavior [#behavior] Keep option labels short and unique. Use groups when a long list has meaningful categories. ## Accessibility [#accessibility] Give the select a label and keep keyboard navigation intact. Users should be able to open, move, select, and close without a mouse. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add select ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue, } from "@/components/ui/select" ``` ```tsx const items = [ { label: "Select framework", value: null }, { label: "Next.js", value: "next" }, { label: "Vite", value: "vite" }, { label: "Astro", value: "astro" }, ] ``` ## Examples [#examples] The examples show sizes, disabled state, alignment, groups, multiple selection, and form integration. For accessible labelling and validation, prefer using the `Field` component to wrap selects. See the related example: [Select field](/ui/docs/components/field#select-field). ### Small Size [#small-size] ### Large Size [#large-size] ### Disabled [#disabled] ### Without Item Alignment [#without-item-alignment] ### With Groups [#with-groups] ### Multiple Selection [#multiple-selection] ### Form Integration [#form-integration] # Separator (/docs/components/separator) ## Overview [#overview] Use Separator to divide related content or controls. Separators are useful in menus, toolbars, cards, settings pages, and layouts where a visual break makes scanning easier. ## Anatomy [#anatomy] A separator is a horizontal or vertical line. It can be decorative or semantic depending on how it is used. ## Usage guidance [#usage-guidance] Use separators sparingly. Spacing and headings should do most of the grouping work. Add a separator when the visual boundary improves clarity. ## Accessibility [#accessibility] If the separator communicates structure, keep it accessible. If it is only decorative, hide it from assistive technology. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add separator ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Separator } from "@/components/ui/separator" ``` ```tsx ``` # Sheet (/docs/components/sheet) ## Overview [#overview] Use Sheet for a panel that slides in from the edge of the screen. Sheets are useful for details panels, filters, side navigation, quick edit forms, carts, and secondary workflows that should keep the current page visible. ## Anatomy [#anatomy] A sheet has a trigger, content panel, header, title, description, body, footer, and close action. It is based on the dialog pattern. ## Behavior [#behavior] Choose the side based on the workflow. Right-side sheets work well for details and editing. Left-side sheets work well for navigation. Bottom sheets can work well on smaller screens. ## Accessibility [#accessibility] Provide a title, keep focus inside while open, and make sure focus returns to the trigger when closed. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add sheet ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger, } from "@/components/ui/sheet" ``` ```tsx Open Are you absolutely sure? This action cannot be undone. This will permanently delete your account and remove your data from our servers. ``` ## Examples [#examples] The example shows sheet placement from different screen edges. ### Side sheets [#side-sheets] # Skeleton (/docs/components/skeleton) ## Overview [#overview] Use Skeleton to reserve space while content is loading. Skeletons are useful for cards, tables, lists, avatars, charts, and forms where the layout is known before the data arrives. ## Anatomy [#anatomy] A skeleton is a neutral placeholder shape. It should roughly match the size and rhythm of the content that will replace it. ## Usage guidance [#usage-guidance] Use skeletons for short loading states where preserving layout helps. Avoid showing too many animated placeholders at once. ## Accessibility [#accessibility] Do not announce every skeleton as content. Pair long loading states with clear loading text when users need to understand what is happening. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add skeleton ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Skeleton } from "@/components/ui/skeleton" ``` ```tsx ``` ## Examples [#examples] The examples show a composed loading layout and a standalone skeleton primitive. ### Skeleton Only [#skeleton-only] # Slider (/docs/components/slider) ## Overview [#overview] Use Slider when users choose a value from a range. Sliders are useful for volume, opacity, price range, thresholds, percentages, and settings where approximate adjustment is faster than typing. ## Anatomy [#anatomy] A slider has a track, range, thumb, value, minimum, maximum, step, and optional label. Range sliders have more than one thumb. ## Behavior [#behavior] Use a number field when exact numeric input is more important than quick adjustment. Use a slider when users benefit from seeing the range visually. ## Accessibility [#accessibility] Provide a label and visible value when the number matters. Keep keyboard controls working for each thumb. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add slider ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Slider, SliderValue } from "@/components/ui/slider" ``` ```tsx ``` ## Examples [#examples] The examples show labeled values, range selection, vertical orientation, and form integration. For accessible labelling and validation, prefer using the `Field` component to wrap checkboxes. See the related example: [Slider field](/ui/docs/components/field#slider-field). ### With Label and Value [#with-label-and-value] ### Range Slider [#range-slider] ### Vertical [#vertical] ### Form Integration [#form-integration] # Switch (/docs/components/switch) ## Overview [#overview] Use Switch for an on/off setting that takes effect immediately or changes a persistent preference. Switches are useful for feature settings, notifications, privacy choices, and simple enabled or disabled states. Use Checkbox when the option is part of a form submission or a list of independent choices. ## Anatomy [#anatomy] A switch has a track, thumb, label, optional description, and checked state. ## Behavior [#behavior] Use clear labels that describe the enabled state. Avoid labels like `On` or `Enable` without context. ## Accessibility [#accessibility] Connect the switch to a label. If changing the switch has a delayed effect, show feedback so users know the update worked. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add switch ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Switch } from "@/components/ui/switch" ``` ```tsx ``` ## Examples [#examples] The examples show disabled, described, card-style, and form-connected switches. For accessible labelling and validation, prefer using the `Field` component to wrap checkboxes. See the related example: [Switch field](/ui/docs/components/field#switch-field). ### Disabled [#disabled] ### With Description [#with-description] ### Card Style [#card-style] ### Form Integration [#form-integration] # Table (/docs/components/table) ## Overview [#overview] Use Table for structured data arranged in rows and columns. Tables are useful for invoices, users, orders, logs, permissions, metrics, and any data where users compare values across rows. ## Anatomy [#anatomy] A table has a caption or surrounding heading, header rows, body rows, cells, and optional footer. Headers should describe the data in each column. ## Usage guidance [#usage-guidance] Use tables for comparison. Use cards or lists when each item has varied content and users do not need column alignment. ## Accessibility [#accessibility] Use table headers correctly so screen readers can understand row and column relationships. Keep action buttons inside rows clearly labeled. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add table ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from "@/components/ui/table" ``` ```tsx Caption Header Header Cell Cell
``` ## Examples [#examples] The examples show a basic table and a framed table surface. ### Framed Table [#framed-table] # Tabs (/docs/components/tabs) ## Overview [#overview] Use Tabs to switch between related panels without leaving the current page. Tabs are useful for settings sections, profile views, code examples, billing panels, and compact content groups. The panels should be peers, not steps in a process. ## Anatomy [#anatomy] Tabs include a root, list, triggers, and content panels. Each trigger controls one panel. ## Behavior [#behavior] Use horizontal tabs for most layouts. Use vertical tabs when labels are longer or when the tab list acts like a side navigation within a page. ## Accessibility [#accessibility] Keep tab labels short and unique. Keyboard users should be able to move through tabs and reach the active panel. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add tabs ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Tabs, TabsList, TabsPanel, TabsTab } from "@/components/ui/tabs" ``` ```tsx Tab 1 Tab 2 Tab 3 Tab 1 content Tab 2 content Tab 3 content ``` ## Examples [#examples] The examples show default tabs, underline styling, vertical orientation, and vertical underline styling. ### Underline Variant [#underline-variant] ### Vertical Orientation [#vertical-orientation] ### Underline with Vertical Orientation [#underline-with-vertical-orientation] # Textarea (/docs/components/textarea) ## Overview [#overview] Use Textarea for multi-line text. Textareas are useful for comments, descriptions, notes, feedback, support messages, and any field where the answer may be longer than one line. ## Anatomy [#anatomy] A textarea has a value, placeholder, size, disabled state, and optional validation state. It should usually be wrapped in Field. ## Usage guidance [#usage-guidance] Use Input for short single-line values. Use Textarea when users need space to write. Set a sensible minimum height so the field does not feel cramped. ## Accessibility [#accessibility] Always provide a label. Add helper text when users need to know expected length, format, or privacy context. ## Installation [#installation] CLI Manual ```bash npx love-ui@latest add textarea ``` Install the following dependencies: ```bash npm install @base-ui-components/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage [#usage] ```tsx import { Textarea } from "@/components/ui/textarea" ``` ```tsx