Select
Readonly native input trigger backed by explicit dropdown and option primitives.
Select composes field, dropdown, option, and the native input select directive.
import {
KuiDropdown,
KuiField,
KuiOption,
KuiSelect,
provideKuiDefaults,
} from '@kikita-labs/ui';Bind value with Angular signals and keep option markup explicit.
<kui-field label="Role" hint="Pick one role for the user">
<input kuiSelect [(value)]="role" placeholder="Select a role..." [clearable]="true" />
<kui-dropdown>
<div kuiOption value="engineer">Software Engineer</div>
<div kuiOption value="designer">Designer</div>
<div kuiOption value="manager">Product Manager</div>
</kui-dropdown>
</kui-field>Set multiple when the value is an array. Selected values render as field chips by default.
<kui-field label="Roles" hint="Multiple mode renders selected values as chips">
<input
kuiSelect
multiple
[(value)]="roles"
[kuiLabelFn]="roleLabel"
[maxVisibleChips]="3"
placeholder="Select roles..."
[clearable]="true"
/>
<kui-dropdown>
@for (role of roleOptions; track role.value) {
<div kuiOption [value]="role.value">{{ role.label }}</div>
}
</kui-dropdown>
</kui-field>Select works with object values. Map the selected object to its display text with kuiLabelFn; options keep the object as their value.
<kui-field label="Role" hint="Object values are shown through kuiLabelFn">
<input kuiSelect [(value)]="role" [kuiLabelFn]="roleLabel" placeholder="Select a role..." />
<kui-dropdown>
@for (role of roles; track role.id) {
<div kuiOption [value]="role">{{ role.label }}</div>
}
</kui-dropdown>
</kui-field>Default multiple mode renders removable kuiChip values. Use ng-template[kuiSelectValue] only when the selected value needs custom markup, per-item appearance or a different remove affordance. The template receives item, label and remove, and hidden values still collapse into the default +N chip.
<kui-field label="Roles" hint="A kuiSelectValue template replaces the default chip">
<input kuiSelect multiple [(value)]="roles" [kuiLabelFn]="roleLabel" />
<ng-template kuiSelectValue let-label="label" let-remove="remove">
<span kuiChip appearance="primary" size="sm">
<span class="kui-chip-label">{{ label }}</span>
<button kuiChipRemove type="button" [attr.aria-label]="'Remove ' + label" (click)="remove()">
x
</button>
</span>
</ng-template>
<kui-dropdown>
@for (role of roleOptions; track role.value) {
<div kuiOption [value]="role.value">{{ role.label }}</div>
}
</kui-dropdown>
</kui-field>Set defaults.select once for the application or for a subtree. Each option resolves as local input > defaults.select.<option> > built-in default.
import { provideKikitaUi } from '@kikita-labs/ui';
export const appConfig: ApplicationConfig = {
providers: [
provideKikitaUi({
defaults: {
select: {
/* options below */
},
},
}),
],
};| Name | Type | Default | Description |
|---|---|---|---|
| clearable | boolean | — | When true, field controls with clear affordances show a clear button by default. |
| multipleDisplay | 'chips' | 'text' | — | How a multiple select shows its selection. |
| maxVisibleChips | number | — | Default visible selected chips before select renders a collapsed +N chip. |
| chevronIcon | KuiIconGlyph | — | Icon of the options toggle. Takes precedence over defaults.icons.pickerChevron. See Structural Icons. |
| clearIcon | KuiIconGlyph | — | Icon of the clear button. Takes precedence over defaults.icons.clear. See Structural Icons. |
Set any of these on the component or an ancestor to restyle one part. Each token is optional: when it is not set, the part uses the role or scale token in the default column.
| Name | Type | Default | Description |
|---|---|---|---|
| --kui-listbox-option-color | CSS custom property | --kui-color-text | Stbox option color |
| --kui-listbox-option-focus-ring-color | CSS custom property | --kui-color-focus | Stbox option focus ring color |
| --kui-listbox-option-bg-selected | CSS custom property | --kui-color-primary-soft-bg | Stbox option background, selected |
| --kui-listbox-option-color-selected | CSS custom property | --kui-color-primary-soft-text | Stbox option color, selected |
| --kui-listbox-option-bg-selected-hover | CSS custom property | --kui-color-primary-soft-bg-hover | Stbox option background, selected hover |
| --kui-listbox-group-label-color | CSS custom property | --kui-color-text-secondary | Stbox group label color |
| --kui-listbox-separator-bg | CSS custom property | --kui-color-border | Stbox separator background |
| --kui-listbox-empty-color | CSS custom property | --kui-color-text-secondary | Stbox empty color |
| --kui-select-chevron-color-expanded | CSS custom property | --kui-color-primary-text | Lect chevron color, expanded |
| Name | Type | Default | Description |
|---|---|---|---|
| --kui-listbox-option-gap | CSS custom property | --kui-space-2 | Option gap |
| --kui-listbox-option-padding-block | CSS custom property | --kui-space-2 | Option padding, block |
| --kui-listbox-option-padding-inline | CSS custom property | --kui-space-3 | Option padding, inline |
| --kui-listbox-option-radius | CSS custom property | --kui-radius-sm | Option corner radius |
| --kui-listbox-option-font-size | CSS custom property | --kui-text-sm-size | Option font size |
| --kui-listbox-group-label-font-size | CSS custom property | --kui-text-xs-size | Group label font size |
| --kui-listbox-group-label-padding-block-start | CSS custom property | --kui-space-2 | Group label padding, block start |
| --kui-listbox-group-label-padding-inline | CSS custom property | --kui-space-3 | Group label padding, inline |
| --kui-listbox-group-label-padding-block-end | CSS custom property | --kui-space-1 | Group label padding, block end |
| --kui-listbox-empty-padding-block | CSS custom property | --kui-space-4 | Empty padding, block |
| --kui-listbox-empty-padding-inline | CSS custom property | --kui-space-3 | Empty padding, inline |
| --kui-listbox-empty-font-size | CSS custom property | --kui-text-sm-size | Empty font size |
| --kui-select-padding-inline-end | CSS custom property | 34px | Input end padding that clears the chevron |
| --kui-select-padding-inline-end-clearable | CSS custom property | 56px | Input end padding that clears the clear button and the chevron |
| --kui-field-clear-icon-size | CSS custom property | 12px | Clear button icon size (Select, Combobox, Date Picker) |
Every text the component owns (accessible names, visible words, announcements) is a typed message with an English default. Override it for the application with provideKikitaUi({ messages }), or for a subtree with provideKuiMessages.
| Name | Type | Default | Description |
|---|---|---|---|
| openOptions | string | — | Name of the open button. Default Open options. |
| closeOptions | string | — | Name of the close button. Default Close options. |
| removeItem | KuiMessageFn<{ label: string; }> | — | Name of the remove button of one chip. Default Remove {label}. |
Inputs and outputs verified against @kikita-labs/ui v2.0.0 public typings.
| Name | Type | Default | Description |
|---|---|---|---|
| value | T | readonly T[] | null | — | Selected value. In multiple mode this is an array. |
| disabled | boolean | — | Disables the native input and prevents opening the dropdown. |
| readonly | boolean | — | Prevents opening the dropdown while keeping the field visually enabled. |
| invalid | boolean | — | Validation state set by Signal Forms or direct input binding. |
| errors | ValidationError[] | — | Validation errors consumed by kui-field for automatic error text. |
| touched | boolean | — | Touched state set by Signal Forms. |
| id | string | — | Explicit id override. Inside kui-field, the field id is used when omitted. |
| multiple | boolean | — | Enables array values and keeps the dropdown open on option selection. |
| maxVisibleChips | number | undefined | — | Maximum selected chips shown before collapsed +N overflow. Falls back to defaults.select.maxVisibleChips, then 3. |
| multipleDisplay | 'chips' | 'text' | — | Renders multiple selections as field chips or plain joined text. |
| multipleTextFn | (items: readonly T[]) => string | — | Formats native input text when multipleDisplay is text. |
| kuiLabelFn | (item: T) => string | — | Maps selected object values to display text. |
| placeholder | string | — | Placeholder on the readonly input. |
| clearable | boolean | undefined | — | Shows a clear button when a value is selected. Resolved as local input, defaults.select.clearable, defaults.field.clearable, then false. |
| touch | output | — | Emitted after an opened dropdown closes for Signal Forms support. |
| ng-template[kuiSelectValue] | context: { $implicit: T; label: string; remove: () => void } | - | Replaces the default chip for each visible selected item in multiple mode. Call remove from a native button to make the item removable. |
| KuiSelectOptions | interface | - | Shape of defaults.select: clearable, multipleDisplay, maxVisibleChips, chevronIcon and clearIcon. |
Select keeps field wiring on kui-field and listbox semantics on dropdown options.
- The trigger input uses combobox semantics and reflects dropdown expanded state.
- Dropdown panel uses listbox semantics; each
kuiOptionis an option. - Use
kui-fieldfor label, hint, error, and described-by wiring. - Each
kuiOptionexposesaria-selectedandaria-disabled. - The clear affordance is a native button named
Clear, and the options toggle is named by thekuiSelect.openOptionsandkuiSelect.closeOptionsmessages. EnterorSpaceopens the dropdown and then selects the focused option;ArrowDownandArrowUpopen it and focus the first or last option;Escapecloses it;Tabcloses it through the focused option flow.- Multiple selected values render removable chip buttons named by the
kuiSelect.removeItemmessage.maxVisibleChipsis count-based and does not measure the field width. touchis emitted after an opened dropdown closes, which marks the control touched for Signal Forms.
Consumer-visible changes of @kikita-labs/ui 2.0 for Select.
- The classes are
KuiSelect,KuiSelectValue,KuiOptionandKuiDropdown; theDirectiveandComponentsuffixes are gone. kuiProvideSelectOptionsandKUI_SELECT_OPTIONSare replaced byprovideKuiDefaults({ select: { ... } });clearableresolves as local input, thendefaults.select, thendefaults.field, thenfalse.- The legacy tokens
--kui-select-bg,--kui-select-border,--kui-select-border-hover,--kui-select-border-focus,--kui-select-border-errorand--kui-select-radiuswere removed; use the shared--kui-input-*tokens. chevronIconandclearIcondefaults set the glyphs of the options toggle and the clear button.- The open, close and chip remove button names come from the
kuiSelectmessages.