Combobox: Trigger rendered as a Button
Pass render to the trigger to use any button. The popup anchors to it and keeps at least its width.
This adds the example as components/examples/combobox/button-trigger.tsx, together with the Combobox component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/combobox-button-trigger.jsonTo add only the component, follow the Combobox installation.
Props in this example
The Combobox props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
itemsThe options. Filtered as you type and passed to the list’s render function. | Item[] | Group[] | – |
defaultValue | Value | Value[] | null | – |
| Prop | Type | Default |
|---|---|---|
placeholder | string | – |
| Prop | Type | Default |
|---|---|---|
renderWhen set, the built-in field styles are skipped. | ReactElement | (props, state) => ReactElement | <button> |
| Prop | Type | Default |
|---|---|---|
valueThe item this row represents. | Item | – |
Every prop is in the Combobox API reference.
- Clear button
- With icons
- Groups and separators
- Multiple
- Search inside the popup
- Controlled
- Disabled, invalid and disabled items
- Long content and large lists
- Async search
- Inside a sheet
- Right to left
See them all, with keyboard support and accessibility notes, on the Combobox page.
- CalendarA date grid for single, range and multiple selection, with sliding months, range previews and touch-sized days.
- CheckboxA checkbox whose check draws in, with indeterminate parents, groups and labels that share its hover.
- Date pickerA button that opens a calendar in a popover, or a bottom sheet on phones, for single dates and ranges.
- FieldLabels, descriptions and errors wired to their control, with validation states and layouts for forms.
- InputA text input with three sizes, invalid and read-only states, native validation styling and a 16px touch font so phones never zoom in.
- Input groupAn input with icons, text, buttons or a keyboard hint attached, sharing one border and focus ring.