Search documentation

Search the documentation and open a page.

Displays a list of options for the user to pick from, triggered by a button.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/select

Composition

<app-select> ├── [appSelectLabel] (optional) ├── [appSelectControl] │ ├── [appSelectTrigger] │ │ └── [appSelectValue] │ ├── <app-select-indicator> │ └── <app-select-clear> (optional) ├── <app-select-content> │ └── generated portal and positioner │ └── [appSelectList] (optional) │ ├── [appSelectItemGroup] (optional) │ │ └── [appSelectItemGroupLabel] (optional) │ ├── [appSelectItem] │ │ ├── [appSelectItemText] (optional) │ │ └── <app-select-item-indicator> │ └── [appSelectSeparator] (optional) └── <select appSelectHiddenSelect> (optional)

Examples

Controlled

Loading...

Default

Loading...

Disabled

Loading...

Groups

Loading...

Invalid State

Loading...

List

Loading...

Long List

Loading...

Multiple Selection

Loading...

Sizes

Loading...

With Icons

Loading...

API Reference

<app-select>

Inputs

InputTypeDefaultDescription
idstring | undefinedgeneratedUnique identifier used to create the select part IDs.
idsSelectElementIds | undefined—Overrides the generated IDs for individual parts.
collectionListCollection<T>requiredTyped collection containing the selectable items.
valuestring[] | undefined—Selected values when controlled. Supports Angular two-way binding.
defaultValuestring[] | undefined[]Initial selected values when uncontrolled.
openboolean | undefined—Open state when controlled. Supports Angular two-way binding.
defaultOpenbooleanfalseInitial open state when uncontrolled.
highlightedValuestring | null | undefined—Highlighted item when controlled. Supports Angular two-way binding.
defaultHighlightedValuestring | null | undefined—Initial highlighted item when uncontrolled.
disabledbooleanfalseDisables interaction with the select.
invalidbooleanfalseMarks the select as invalid.
readOnlybooleanfalsePrevents changes while preserving focus and navigation.
requiredbooleanfalseMarks the select as required.
multiplebooleanfalseAllows multiple values to be selected.
closeOnSelectboolean | undefined!multipleCloses the content after an item is selected.
loopFocusbooleanfalseLoops keyboard focus through the collection.
deselectablebooleanfalseAllows the selected item to be deselected.
compositeboolean | undefinedtrueUses composite listbox keyboard behavior.
namestring | undefined—Name used when submitting the value with a form.
formstring | undefined—Associates the select with a form by ID.
autoCompletestring | undefined—Native autocomplete value used by the hidden select.
positioningSelectPositioningOptions | undefined—Configures floating placement and collision handling.
scrollToIndexFn((details: SelectScrollToIndexDetails) => void) | undefined—Scrolls a virtualized collection to the requested index.
translationsSelectIntlTranslations | undefined—Overrides accessible text used by the select.
height"default" | "sm" | "lg" | "xl""default"Sets the trigger height styling.

Outputs

OutputTypeDescription
valueChangestring[] | undefinedEmits the current selected values.
openChangeboolean | undefinedEmits the current open state.
highlightedValueChangestring | null | undefinedEmits the current highlighted value.
valueChangeDetailsSelectValueChangeDetails<T>Emits details whenever the selected values change.
highlightChangeSelectHighlightChangeDetails<T>Emits details whenever the highlighted item changes.
openChangeDetailsSelectOpenChangeDetailsEmits details whenever the open state changes.
selectSelectSelectionDetailsEmits when an item is selected.
focusOutsideSelectFocusOutsideEventEmits when focus moves outside the content.
pointerDownOutsideSelectPointerDownOutsideEventEmits when a pointer is pressed outside the content.
interactOutsideSelectInteractOutsideEventEmits when an interaction occurs outside the content.

[appSelectValue]

Inputs

InputTypeDefaultDescription
placeholderstring | undefined—Text shown when the select has no selected values.

<app-select-content>

Inputs

InputTypeDefaultDescription
classstring""Additional classes applied to the content panel.

[appSelectItem]

Inputs

InputTypeDefaultDescription
itemTrequiredCollection item represented by this option.
persistFocusbooleanfalsePreserves focus on the item while the list updates.

[appSelectItemGroup]

Inputs

InputTypeDefaultDescription
idstring | undefinedgeneratedIdentifier used to connect a group label.

Context, Providers, and Utilities

ExportAngular API
SelectRootProviderDirective that provides an externally created select API through value.
SelectContextStructural directive [select-context] exposing the root API to a template.
SelectItemContextDirectiveStructural directive [select-item-context] exposing item state.
useSelect(options)Creates the signal-backed select machine inside an injection context.
injectSelectContext()Injects the nearest select root context.
injectSelectContextCarrier()Injects the carrier used to preserve context through portals.
injectSelectItemContext()Injects the nearest select-item context.
injectSelectItemGroupContext()Injects the nearest select-item-group context.
createListCollection(options)Creates the typed collection consumed by the select.
useListCollection(options)Creates a reactive Angular list collection.
SelectImportsReadonly collection containing the select UI and context helpers.

Types

ExportDescription
SelectApi<T>Connected select state and actions.
SelectElementIdsOverrides for generated select part IDs.
SelectItemPropsProps used to derive the state of a select item.
SelectItemStateDerived state for a select item.
SelectPositioningOptionsFloating placement and collision options.
SelectValueChangeDetails<T>Details emitted by valueChangeDetails.
SelectHighlightChangeDetails<T>Details emitted by highlightChange.
SelectOpenChangeDetailsDetails emitted by openChangeDetails.
SelectSelectionDetailsDetails emitted by select.
SelectItemContext<T>Signal-backed state exposed for the nearest item.
SelectItemGroupContextSignal-backed state exposed for the nearest item group.
UseSelectApi<T>Typed API returned by the Angular select machine.
UseSelectOptions<T>Options accepted by useSelect.
UseSelectProps<T>Root props accepted by the select machine.
UseSelectReturn<T>Signal-backed select machine returned by useSelect.
CollectionItemBase shape supported by list collections.
ListCollection<T>Typed collection consumed by the select.
UseListCollectionProps<T>Options accepted by useListCollection.