<kern-select>
Labelled choice with its own dropdown list, form-associated. Options come from the options property or from child <option> elements (kept in sync, so @for / *ngFor over options works). Elements in the footer slot appear below the list, e.g. a button "Standorte bearbeiten"; clicking one closes the list.
searchable adds a search field to the list (filters by label). multiple makes value a string[]: the field shows chips (× removes, Backspace removes the last), the list stays open and toggles options; the form gets one entry per value.
Keyboard: Enter, Space or Arrow keys open; Arrow keys, Home, End and typing a letter move; Enter or Space picks; Escape closes; Tab moves on to the footer.
Examples
Basic select
Options come from child <option> elements (disabled and selected are read). Keyboard: Enter, Space or the arrow keys open the list; arrow keys, Home, End or typing a letter move; Enter or Space picks; Escape closes.
Searchable and multiple
searchable adds a search field that filters by label. With multiple, value is a string[] shown as chips (× or Backspace removes one), the list stays open while you toggle options, and the form receives one entry per value.
Options property and footer
The options property ({ value, label, disabled? }[]) takes precedence over child elements and suits data from an API. Buttons in the footer slot appear below the list; clicking one closes it.
Options with icons
data-icon on an <option> puts a kern-icon before the label, in the list and in the field (icon in options). aria-label gives a short label its full name for screen readers, lang marks its language.
Properties
ariaLabelTextstring | undefined
Accessible name when there is no visible label.
disabledboolean
errorstring | undefined
hintstring | undefined
labelstring | undefined
labelNoResultsstring | undefined
labelRemovestring | undefined
Accessible name of a chip's ×; {label} is replaced.
labelSearchstring | undefined
multipleboolean
Several values; value becomes a string[].
namestring | undefined
optionsKernOption[] | undefined
Takes precedence over child <option> elements.
placeholderstring | undefined
Shown when no option is selected.
requiredboolean
searchableboolean
Search field in the list; filters options by label.
size"md" | "sm"
valuestring | string[]
The picked value; with multiple a string[] (a comma-separated attribute is accepted).
Events
kernChangeCustomEvent<{ value: string | string[]; }>
When the user picks (or, with multiple, toggles) an option.
Methods
hide()hide() => Promise<void>
Closes the dropdown.
setFocus()setFocus() => Promise<void>
show()show() => Promise<void>
Opens the dropdown.
Slots
(default)<option> elements (read, not shown)
footerActions below the list (kern-button variant="ghost" size="sm")
CSS parts
chipEach chip (multiple)
controlThe trigger
listboxThe dropdown panel
optionEach option