Componentpickers2.39 KB gzipZero dependencies
Combobox
Filterable searchable dropdown with instant keyboard filter.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add comboboxOr install the full npm package:
npm install bigbulluiUsage
tsx9 lines
import { Combobox } from "@/components/ui/combobox"; <Combobox options={[ { value: "orch", label: "Orchestra" }, { value: "balc", label: "Balcony" }, ]} placeholder="Select seat..."/>Source code
combobox.tsx + 5 helpersZero third-party dependencies (6 local files shown in tabs below).
tsxcombobox.tsx355 lines
"use client"; import * as React from "react";import { createPortal } from "react-dom";import { cn } from "./lib/utils";import { mergeRefs, useIsMounted } from "./lib/react-compat";import { useControllableState } from "./lib/use-controllable-state";import { useFloating } from "./lib/floating";import { registerEscapeLayer } from "./lib/focus-trap"; export interface ComboboxOption { value: string; label: string; disabled?: boolean;} export interface ComboboxProps { options: ComboboxOption[];Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { Combobox } from "@/components/ui/combobox"; <Combobox />| Prop | Type | Description |
|---|---|---|
| options | ComboboxOption[] | Selectable options list. (Default: []) |
| value | string | Controlled value. |
| defaultValue | string | Initial value when uncontrolled. (Default: "") |
| onValueChange | (value: string) => void | Callback invoked on value change. |
| placeholder | string | Placeholder text shown when empty. (Default: "Select an option...") |
| searchPlaceholder | string | Configures search placeholder. (Default: "Type to search...") |
| emptyText | string | Configures empty text. (Default: "No items match.") |
| disabled | boolean | Disables interaction and applies disabled styling. (Default: false) |
| required | boolean | Marks the input as required for native form validation. (Default: false) |
| name | string | Form field name submitted during form serialization. |
| id | string | DOM element identifier for label association and testing. |
| aria-label | string | Configures aria label. |
| animated | boolean | Dual-mode: false renders instantly with no motion. Default true. |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |