Getting Started
Foundations
Components
Search for a command to run...
ComboBox provides an autocomplete or command palette interface where users can type to filter and search through options. It's ideal for selecting from large lists where scrolling would be impractical. The component combines the functionality of a text input with a dropdown menu, offering type-ahead search and keyboard navigation.
import { Combobox } from "@strongtie/design-system/combobox"This module exports the following components:
ComboBoxComboBoxTriggerComboBoxTriggerInputComboBoxContentComboBoxInputComboBoxListComboBoxEmptyComboBoxItemGroupComboBoxItem<ComboBoxTriggerInput>This component accepts the following custom props. For additional props inherited from Radix UI primitives see the Radix UI documentation.
| Prop | Type | Default | Description |
|---|---|---|---|
onValueChange | ((search: string) => void) | - | Event handler called when the search value changes. |
value | string | - | Optional controlled state for the value of the search input. |
<ComboBoxInput>This component accepts the following custom props. For additional props inherited from Radix UI primitives see the Radix UI documentation.
| Prop | Type | Default | Description |
|---|---|---|---|
icon | ElementType<any, keyof IntrinsicElements> | null | - | |
onValueChange | ((search: string) => void) | - | Event handler called when the search value changes. |
value | string | - | Optional controlled state for the value of the search input. |
<ComboBoxList>This component accepts the following custom props. For additional props inherited from Radix UI primitives see the Radix UI documentation.
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | - | Accessible label for this List of suggestions. Not shown visibly. |
<ComboBoxItemGroup>This component accepts the following custom props. For additional props inherited from Radix UI primitives see the Radix UI documentation.
| Prop | Type | Default | Description |
|---|---|---|---|
forceMount | boolean | - | Whether this group is forcibly rendered regardless of filtering. |
heading | ReactNode | - | Optional heading to render for this group. |
value | string | - | If no heading is provided, you must provide a value that is unique for this group. |
<ComboBoxItem>This component accepts the following custom props. For additional props inherited from Radix UI primitives see the Radix UI documentation.
| Prop | Type | Default | Description |
|---|---|---|---|
disabled | boolean | - | Whether this item is currently disabled. |
forceMount | boolean | - | Whether this item is forcibly rendered regardless of filtering. |
keywords | string[] | - | Optional keywords to match against when filtering. |
onSelect | ((value: string) => void) | - | Event handler for when this item is selected, either via click or keyboard selection. |
selected | boolean | false | Whether this item is currently selected. |
value | string | - | A unique value for this item. If no value is provided, it will be inferred from children or the rendered textContent. If your textContent changes between renders, you must provide a stable, unique value. |
Components can be styled using the className prop. The design system uses Tailwind CSS for styling.
The following data attributes are used to identify component parts:
combobox-triggerOther CSS classes used by this component:
-selectedcomboboxcombobox-emptycombobox-inputcombobox-itemcombobox-item-groupcombobox-listcombobox-triggercombobox-trigger-inputmenu-itemThis component inherits accessibility features from Radix UI, including: