Components

Select ​

Selects expose a constrained list of options while keeping the closed trigger aligned with surrounding field controls.

Basic Usage ​

Use a trigger plus content list for the common closed-select pattern.

Sizes ​

The select trigger follows the same sizing rhythm as other form controls so it can sit cleanly beside inputs, buttons, and other CP fields.

Widths ​

Select triggers use their content width by default. Add a width utility to the trigger when the control should be fixed-width or fill its parent.

Grouped Options ​

Labels and separators help when a single list includes more than one logical option set.

Decorations ​

Host start / end slots decorate the closed trigger (icons, status dots, and similar).

Status Options ​

Put Status in an option’s start slot when the list represents Craft-like statuses.

API ​

Select ​

Slots ​

NameDescription
startPresentational decoration before the trigger label (e.g. icons)
endPresentational decoration before the expand chevron
(default)pk-option and pk-option-group items

Props ​

NameDescription
ariaLabelAccessible name for the trigger when no visible label is present.
Type string | null
Default null
clearableAlias of with-clear — shows a clear control when the value is non-empty.
Type boolean
Default false
customErrorCustom validation message; also settable via setCustomValidity().
Type string | null
Default null
defaultValueInitial value before user interaction (form reset baseline).
Type string
defaultValuesInitial multi values before user interaction. Property-only.
Type string[]
Default []
disabledDisables the control and excludes it from constraint validation.
Type boolean
Default false
invalidMarks the control invalid (visual + ARIA).
Type boolean
Default false
isInvalidAlias for invalid.
loopFocusWhether arrow-key focus loops from the last option back to the first (and vice versa). Base UI Select has no equivalent; default: false.
Type boolean
Default false
multipleAllow more than one option to be selected (tag display).
Type boolean
Default false
nameName submitted with form data.
Type string | null
Default null
openWhether the listbox is open. Prefer show() / hide() for animated transitions.
Type boolean
Default false
placeholderPrompt shown when nothing is selected. Empty by default.
Type string
placementPreferred listbox placement; may flip to stay in viewport.
Type PkPopupPlacement
Default bottom-start
requiredMarks the control as required for form submission.
Type boolean
Default false
sideOffsetGap between the trigger and listbox panel in px.
Type number
Default 4
sizeShared CP size scale for the closed trigger and list items.
Type PkSelectSize
Default default
valueSelected value (single-select). Empty string when cleared.
Type string
valuesSelected values when multiple is set. Property-only (not an attribute).
Type string[]
Default []
widthWhen full, the trigger stretches to the host width.
Type 'full' | undefined
withClearShows a clear control when the value is non-empty.
Type boolean
Default false

Methods ​

NameDescription
checkValidity()Runs constraint validation without showing the browser UI.
hide(source: PkOverlaySource)Closes the listbox.
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()Opens the listbox.

Events ​

NameDescription
@changeNative change event when the selection changes.
@inputNative input event when the selection changes.
@pk-after-hideEmitted after the listbox closes and exit motion finishes.
@pk-after-showEmitted after the listbox opens and enter motion finishes.
@pk-changeEmitted when the selection changes.
Type { value: string, values: string[] }
@pk-clearEmitted when the value is cleared via the clear control.
@pk-hideEmitted when the listbox begins to close (cancelable).
Type { source: string }
@pk-invalidEmitted when constraint validation fails.
@pk-open-changeEmitted when open changes after show/hide settles.
Type { open: boolean }
@pk-showEmitted when the listbox begins to open.

CSS Custom Properties ​

NameDescription
--pk-select-anchor-widthPanel min-width; set from the trigger width while open.
--pk-select-decoration-sizeStart/end decoration glyph size.
Default 0.875rem
--pk-select-fillClosed trigger background.
Default var(--pk-color-slate-250)
--pk-select-fill-hoverClosed trigger hover background.
Default var(--pk-color-slate-300)

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
controlTrigger control wrapper::part(control)
endHost end decoration container::part(end)
panelListbox panel::part(panel)
startHost start decoration container::part(start)
triggerSelect trigger button::part(trigger)
trigger-startMirrored start decoration from the selected option::part(trigger-start)

Dependencies ​

This component registers the following elements when it loads.

NameDescription
pk-popupPositioned listbox panel host.

Option ​

Slots ​

NameDescription
startPresentational decoration before the label (e.g. pk-status).
(default)Option label

Props ​

NameDescription
disabledDisables the option so it cannot be selected.
Type boolean
Default false
focusIndexType number
Default -1
hiddenHides the option from the list (e.g. filtered combobox results).
Type boolean
Default false
highlightedKeyboard / pointer highlight within the listbox.
Type boolean
Default false
labelOptional short label for the closed trigger / filter identity (v1 itemToStringLabel). When set, preferred over concatenating rich default-slot text (title + subtitle).
Type string
matchQueryWhen set, the label renders with matching query text highlighted (combobox filter).
Type string
optionIdType string
selectedWhether this option is currently selected.
Type boolean
Default false
valueOption value submitted / emitted when selected.
Type string

Methods ​

NameDescription
focusControl(preventScroll)Focus the option’s inner control (listbox keyboard navigation).
getLabel()Label for the closed combobox/select value. Prefers the label attribute when set; otherwise default-slot text (excluding slot="start"), joined with spaces for multi-node layouts.

Events ​

NameDescription
@pk-option-highlightEmitted when the option becomes the highlighted item.
@pk-option-selectEmitted when the option is activated (click / Enter).

CSS Parts ​

NameDescriptionCSS selector
checkSelected-state check indicator::part(check)
labelOption label::part(label)
optionOption button::part(option)
startStart decoration container::part(start)

OptionGroup ​

Slots ​

NameDescription
(default)pk-option items in this group

Props ​

NameDescription
hiddenHides the group and its options.
Type boolean
Default false
labelVisible group heading above the options.
Type string

CSS Parts ​

NameDescriptionCSS selector
labelGroup label::part(label)
Edit this page
Last updated: Sep 9, 2026, 7:18 PM