Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
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
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Unique identifier used to create the select part IDs. |
ids | SelectElementIds | undefined | — | Overrides the generated IDs for individual parts. |
collection | ListCollection<T> | required | Typed collection containing the selectable items. |
value | string[] | undefined | — | Selected values when controlled. Supports Angular two-way binding. |
defaultValue | string[] | undefined | [] | Initial selected values when uncontrolled. |
open | boolean | undefined | — | Open state when controlled. Supports Angular two-way binding. |
defaultOpen | boolean | false | Initial open state when uncontrolled. |
highlightedValue | string | null | undefined | — | Highlighted item when controlled. Supports Angular two-way binding. |
defaultHighlightedValue | string | null | undefined | — | Initial highlighted item when uncontrolled. |
disabled | boolean | false | Disables interaction with the select. |
invalid | boolean | false | Marks the select as invalid. |
readOnly | boolean | false | Prevents changes while preserving focus and navigation. |
required | boolean | false | Marks the select as required. |
multiple | boolean | false | Allows multiple values to be selected. |
closeOnSelect | boolean | undefined | !multiple | Closes the content after an item is selected. |
loopFocus | boolean | false | Loops keyboard focus through the collection. |
deselectable | boolean | false | Allows the selected item to be deselected. |
composite | boolean | undefined | true | Uses composite listbox keyboard behavior. |
name | string | undefined | — | Name used when submitting the value with a form. |
form | string | undefined | — | Associates the select with a form by ID. |
autoComplete | string | undefined | — | Native autocomplete value used by the hidden select. |
positioning | SelectPositioningOptions | undefined | — | Configures floating placement and collision handling. |
scrollToIndexFn | ((details: SelectScrollToIndexDetails) => void) | undefined | — | Scrolls a virtualized collection to the requested index. |
translations | SelectIntlTranslations | undefined | — | Overrides accessible text used by the select. |
height | "default" | "sm" | "lg" | "xl" | "default" | Sets the trigger height styling. |
Use [(value)]="value", [(open)]="open", or [(highlightedValue)]="highlightedValue" for
two-way binding. The component also implements Angular's ControlValueAccessor for forms
integration.
Outputs
| Output | Type | Description |
|---|---|---|
valueChange | string[] | undefined | Emits the current selected values. |
openChange | boolean | undefined | Emits the current open state. |
highlightedValueChange | string | null | undefined | Emits the current highlighted value. |
valueChangeDetails | SelectValueChangeDetails<T> | Emits details whenever the selected values change. |
highlightChange | SelectHighlightChangeDetails<T> | Emits details whenever the highlighted item changes. |
openChangeDetails | SelectOpenChangeDetails | Emits details whenever the open state changes. |
select | SelectSelectionDetails | Emits when an item is selected. |
focusOutside | SelectFocusOutsideEvent | Emits when focus moves outside the content. |
pointerDownOutside | SelectPointerDownOutsideEvent | Emits when a pointer is pressed outside the content. |
interactOutside | SelectInteractOutsideEvent | Emits when an interaction occurs outside the content. |
[appSelectValue]
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
placeholder | string | undefined | — | Text shown when the select has no selected values. |
<app-select-content>
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
class | string | "" | Additional classes applied to the content panel. |
[appSelectItem]
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
item | T | required | Collection item represented by this option. |
persistFocus | boolean | false | Preserves focus on the item while the list updates. |
[appSelectItemGroup]
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Identifier used to connect a group label. |
Context, Providers, and Utilities
| Export | Angular API |
|---|---|
SelectRootProvider | Directive that provides an externally created select API through value. |
SelectContext | Structural directive [select-context] exposing the root API to a template. |
SelectItemContextDirective | Structural 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. |
SelectImports | Readonly collection containing the select UI and context helpers. |
Types
| Export | Description |
|---|---|
SelectApi<T> | Connected select state and actions. |
SelectElementIds | Overrides for generated select part IDs. |
SelectItemProps | Props used to derive the state of a select item. |
SelectItemState | Derived state for a select item. |
SelectPositioningOptions | Floating placement and collision options. |
SelectValueChangeDetails<T> | Details emitted by valueChangeDetails. |
SelectHighlightChangeDetails<T> | Details emitted by highlightChange. |
SelectOpenChangeDetails | Details emitted by openChangeDetails. |
SelectSelectionDetails | Details emitted by select. |
SelectItemContext<T> | Signal-backed state exposed for the nearest item. |
SelectItemGroupContext | Signal-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. |
CollectionItem | Base shape supported by list collections. |
ListCollection<T> | Typed collection consumed by the select. |
UseListCollectionProps<T> | Options accepted by useListCollection. |
Angular
React
Solid
Svelte
Vue