Components

Combobox ​

Comboboxes mix freeform search with constrained option selection.

Input Mode ​

Input mode works well when the control should feel like a searchable text field with inline suggestions.

Sizes ​

The combobox input and option list follow the same sizing rhythm as select so searchable controls can align with adjacent fields.

Widths ​

Combobox input controls use their content width by default. Add a width utility to the input when the control should be fixed-width or fill its parent.

Popup mode is a better fit when the trigger should behave more like a select than a text field.

Multiple Selection ​

Chips are useful when the chosen options need to remain visible after selection.

Grouped Options ​

Grouped content is useful when the option list should be organized into labeled collections.

Allow Create ​

allowCreate offers creating a new option when the typed query isn’t already in the list.

Custom Values ​

allowCustomValue lets a single-select keep typed text that doesn’t match an option.

Higher-Level Input API ​

Combobox covers the common single-select and async loading cases — static Option children for local lists, or async + fetchOptions when results come from a remote search.

Set async and assign fetchOptions={(query, signal) => ...} (a JS property) so options load as the user types. No static Option children are needed — the control owns loading and empty states.

API ​

Slots ​

NameDescription
startPresentational decoration before the input (e.g. icons)
endPresentational decoration before the expand/clear controls
(default)pk-option and pk-option-group items

Props ​

NameDescription
allowCreateType boolean
Default false
allowCustomValueType boolean
Default false
ariaLabelType string | null
Default null
asyncWhen true, options are loaded via fetchOptions as the user types instead of filtering static pk-option children.
Type boolean
Default false
autoHighlightWhen true, the first matching option is highlighted on open or when filtering.
Type boolean
Default false
clearableType boolean
Default false
customErrorCustom validation message; also settable via setCustomValidity().
Type string | null
Default null
defaultValueType string
disabledDisables the control and excludes it from constraint validation.
Type boolean
Default false
emptyMessageType string
Default No options found.
fetchOptionsRemote search handler — (query, signal) => Promise<options>.
Type PkComboboxFetchHandler | null
Default null
filterCustom filter — (option, query) => boolean. Defaults to label/value substring match.
Type PkComboboxFilter | null
Default null
instructionsType string
invalidType boolean
Default false
isInvalidAlias for invalid.
labelType string
loadingMessageMessage shown while async results are loading.
Type string
Default Searching…
loopFocusWhether arrow-key focus loops from the last option back to the first (and vice versa). Mirrors Base UI Combobox — default: true.
Type boolean
Default true
multipleType boolean
Default false
nameName submitted with form data.
Type string | null
Default null
openType boolean
Default false
placeholderEmpty by default — consumers opt in when a prompt is useful.
Type string
placementType PkPopupPlacement
Default bottom-start
popupModeWhen true, the control shows a trigger button and the search field renders inside the popup.
Type boolean
Default false
requiredMarks the control as required for form submission.
Type boolean
Default false
searchPlaceholderType string
Default Search
sideOffsetGap between the control and listbox panel in px (default: 6).
Type number
Default 6
sizeType PkComboboxSize
Default default
startTypingMessageMessage shown before the user types in async mode.
Type string
Default Start typing to search…
valueType string
widthWhen full, the control stretches to the host width.
Type 'full' | undefined
withClearType boolean
Default false

Methods ​

NameDescription
checkValidity()Runs constraint validation without showing the browser UI.
hide(source: PkOverlaySource)—
reportValidity()Runs constraint validation and shows the browser UI when invalid.
resetValidity()Clears custom errors and re-syncs validity state.
setCustomValidity(message: string)Sets or clears a custom validation message.
show()—

Events ​

NameDescription
@change—
@input—
@pk-change—
@pk-createCancelable. Fired before a new option is created when allow-create is enabled.
@pk-open-change—

Custom States ​

NameDescriptionCSS selector
disabledThe control is disabled.:state(disabled)
invalidThe control currently fails constraint validation.:state(invalid)
optionalThe control is not required.:state(optional)
requiredThe control is required.:state(required)
user-invalidInvalid after the user has interacted with the control.:state(user-invalid)
user-validValid after the user has interacted with the control.:state(user-valid)
validThe control currently passes constraint validation.:state(valid)

CSS Parts ​

NameDescriptionCSS selector
async-statusAsync search status message::part(async-status)
clear-buttonClear selection button::part(clear-button)
controlInput control wrapper::part(control)
emptyEmpty-state message::part(empty)
endHost end decoration container::part(end)
expand-buttonToggle listbox button::part(expand-button)
inputCombobox text input::part(input)
panel-bodyScrollable listbox region inside the popup panel::part(panel-body)
panel-inputPopup-mode search input::part(panel-input)
panel-searchPopup-mode search field container::part(panel-search)
startHost start decoration container::part(start)
tagIndividual multiselect chip::part(tag)
tag-removeChip remove button::part(tag-remove)
tagsMultiselect chip container::part(tags)
triggerPopup-mode trigger button (shows the selected value)::part(trigger)

Dependencies ​

This component registers the following elements when it loads.

NameDescription
pk-popup—
Edit this page
Last updated: Sep 9, 2026, 7:18 PM