Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Combobox

Preview

Workspace

Install

Add it with your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/combobox

Import the shared styles once in your application.

TSUsage
import Combobox from '@/components/beui/controls/choice/Combobox.vue'
import '@/components/beui/styles.css'

API Reference

ComboboxContent

side?
"top" | "bottom"

Which side of the field the panel opens on.

Defaultbottom
align?
"start" | "center" | "end"

Alignment along the field's edge.

Defaultstart
sideOffset?
number

Gap between field and panel, in px.

Default6
avoidCollisions?
boolean

Flip to the other side when the preferred one does not fit.

Defaulttrue
class?
string
Default—
#default?
slot
Default—

Combobox

v-model?
string
Defaultundefined
defaultValue?
string
Defaultundefined
v-model:open?
boolean
Defaultundefined
defaultOpen?
boolean
Defaultfalse
v-model:query?
string
Defaultundefined
defaultQuery?
string
Default
filter?
ComboFilter
DefaultdefaultFilter
disabled?
boolean
Defaultfalse
class?
string
Default—
labels?
ComboLabels

Override any built-in string.

Default—
options?
readonly ChoiceOption[]

Render the field from a list of options instead of composing parts.

Defaultundefined
label?
string

Accessible name of the search input.

Default—
placeholder?
string
Default—
empty?
string

Text shown when nothing matches.

Default—
listLabel?
string

Accessible name of the list.

Default—
side?
"top" | "bottom"
Defaultbottom
align?
"start" | "center" | "end"
Defaultstart
sideOffset?
number
Default6
avoidCollisions?
boolean
Defaulttrue
groupSeparator?
boolean

Draw a divider between option groups.

Default—
showIcon?
boolean

Show the search glyph in the input (always on for the single combobox).

Default—
triggerStyle?
ComboStyle
Default—
contentStyle?
ComboStyle
Default—
listStyle?
ComboStyle
Default—
name?
string

Form field name; a hidden input carries the selected value.

Default—
#default?
slot
Default—
#option?
{ option: ChoiceOption; selected: boolean; active: boolean }

Row content in `options` mode.

Default—

ComboboxEmpty

class?
string
Default—
#default?
slot
Default—

ComboboxGroup

class?
string
Default—
#default?
slot
Default—

ComboboxItem

value
string
Default—
textValue?
string

Plain-text label used for filtering, the input and chips. Defaults to the item's text when it is plain text, else `value`.

Default—
keywords?
string[]

Extra words the filter matches besides the label.

Default[]
disabled?
boolean
Defaultfalse
@select?
(value: string) => void

Fires when this option is chosen.

Default—
class?
string
Default—
#default?
{ selected: boolean; active: boolean }
Default—

ComboboxLabel

class?
string
Default—
#default?
slot
Default—

ComboboxList

ariaLabel?
string

Accessible name of the list.

Default—
class?
string
Default—
#default?
slot
Default—

ComboboxSeparator

class?
string
Default—

ComboboxInput

wrapperClassName?
string

Class for the element that wraps the icon and the input.

Default—
class?
string
Default—

ComboboxTrigger

class?
string
Default—
#default?
slot
Default—

ComboboxValue

placeholder?
string
Default—
class?
string
Default—
#default?
{ value: string | undefined; label: string | undefined }

Replaces the label.

Default—
#placeholder?
slot

Placeholder content when nothing is selected.

Default—

Composition

Place the searchable input inside the trigger, then compose listbox primitives inside the portalled content.

Combobox
├── ComboboxTrigger
│   └── ComboboxInput
└── ComboboxContent
    └── ComboboxList
        ├── ComboboxEmpty
        ├── ComboboxGroup
        │   ├── ComboboxLabel
        │   └── ComboboxItem
        └── ComboboxSeparator

How it works

A combobox combines text input with a filtered listbox while keeping focus in the input. It manages search, active-option navigation, selection, and portal positioning without owning the option data or surrounding form.

Updated