- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Code Block
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Message Scroller
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Questionnaire
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner (Toast)
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Tooltip
- Trace
Select
Select a value from a list of options.
import { Component } from '@angular/core';
import { HlmSelectImports } from '@spartan-ng/helm/select';
@Component({
selector: 'spartan-select-preview',
imports: [HlmSelectImports],
template: `
<hlm-select [itemToString]="itemToString">
<hlm-select-trigger class="w-56">
<hlm-select-value placeholder="Select a fruit" />
</hlm-select-trigger>
<hlm-select-content *hlmSelectPortal>
<hlm-select-group>
<hlm-select-label>Fruits</hlm-select-label>
@for (item of items; track item.value) {
<hlm-select-item [value]="item.value">{{ item.label }}</hlm-select-item>
}
</hlm-select-group>
</hlm-select-content>
</hlm-select>
`,
})
export class SelectPreview {
public readonly items = [
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Blueberry', value: 'blueberry' },
{ label: 'Grapes', value: 'grapes' },
{ label: 'Pineapple', value: 'pineapple' },
];
public readonly itemToString = (value: string) => this.items.find((item) => item.value === value)?.label || '';
}Installation
ng g @spartan-ng/cli:ui selectnx g @spartan-ng/cli:ui selectUsage
import { HlmSelectImports } from '@spartan-ng/helm/select';<hlm-select>
<hlm-select-trigger>
<hlm-select-value placeholder="Select a fruit" />
</hlm-select-trigger>
<hlm-select-content *hlmSelectPortal>
<hlm-select-group>
<hlm-select-label>Fruits</hlm-select-label>
@for (item of items; track item.value) {
<hlm-select-item [value]="item.value">{{ item.label }}</hlm-select-item>
}
</hlm-select-group>
</hlm-select-content>
</hlm-select>@import '@angular/cdk/overlay-prebuilt.css';Examples
Groups
import { Component } from '@angular/core';
import { HlmSelectImports } from '@spartan-ng/helm/select';
@Component({
selector: 'spartan-select-group-preview',
imports: [HlmSelectImports],
template: `
<hlm-select>
<hlm-select-trigger class="w-56">
<hlm-select-value placeholder="Select a fruit" />
</hlm-select-trigger>
<hlm-select-content *hlmSelectPortal>
<hlm-select-group>
<hlm-select-label>Fruits</hlm-select-label>
@for (fruit of fruits; track fruit.value) {
<hlm-select-item [value]="fruit">{{ fruit.label }}</hlm-select-item>
}
</hlm-select-group>
<hlm-select-separator />
<hlm-select-group>
<hlm-select-label>Vegetables</hlm-select-label>
@for (vegetable of vegetables; track vegetable.value) {
<hlm-select-item [value]="vegetable">{{ vegetable.label }}</hlm-select-item>
}
</hlm-select-group>
</hlm-select-content>
</hlm-select>
`,
})
export class SelectGroupPreview {
public readonly fruits = [
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Blueberry', value: 'blueberry' },
{ label: 'Grapes', value: 'grapes' },
{ label: 'Pineapple', value: 'pineapple' },
];
public readonly vegetables = [
{ label: 'Carrot', value: 'carrot' },
{ label: 'Broccoli', value: 'broccoli' },
{ label: 'Spinach', value: 'spinach' },
];
}Multiple
import { Component } from '@angular/core';
import { HlmSelectImports } from '@spartan-ng/helm/select';
@Component({
selector: 'spartan-select-multiple-preview',
imports: [HlmSelectImports],
template: `
<hlm-select-multiple>
<hlm-select-trigger class="w-56">
<hlm-select-placeholder>Select fruits</hlm-select-placeholder>
<ng-template hlmSelectValues let-values>
<hlm-select-values-content>
{{ values[0].label }}
@if (values.length > 1) {
(+{{ values.length - 1 }} more)
}
</hlm-select-values-content>
</ng-template>
</hlm-select-trigger>
<hlm-select-content *hlmSelectPortal>
<hlm-select-group>
<hlm-select-label>Fruits</hlm-select-label>
@for (item of items; track item.value) {
<hlm-select-item [value]="item">{{ item.label }}</hlm-select-item>
}
</hlm-select-group>
</hlm-select-content>
</hlm-select-multiple>
`,
})
export class SelectMultiplePreview {
public readonly items = [
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Blueberry', value: 'blueberry' },
{ label: 'Grapes', value: 'grapes' },
{ label: 'Pineapple', value: 'pineapple' },
];
}Scrollable
import { Component } from '@angular/core';
import { HlmSelectImports } from '@spartan-ng/helm/select';
@Component({
selector: 'spartan-select-scrollable-preview',
imports: [HlmSelectImports],
template: `
<hlm-select [itemToString]="itemToString">
<hlm-select-trigger class="w-80">
<hlm-select-value placeholder="Select a time zone" />
</hlm-select-trigger>
<hlm-select-content *hlmSelectPortal showScroll class="max-h-96">
@for (timezone of timezones; track $index) {
<hlm-select-group>
<hlm-select-label>{{ timezone.group }}</hlm-select-label>
@for (option of timezone.options; track $index) {
<hlm-select-item [value]="option.value">{{ option.label }}</hlm-select-item>
}
</hlm-select-group>
}
</hlm-select-content>
</hlm-select>
`,
})
export class SelectScrollablePreview {
public readonly timezones = [
{
group: 'North America',
options: [
{ label: 'Eastern Standard Time', value: 'est' },
{ label: 'Central Standard Time', value: 'cst' },
{ label: 'Mountain Standard Time', value: 'mst' },
{ label: 'Pacific Standard Time', value: 'pst' },
{ label: 'Alaska Standard Time', value: 'akst' },
{ label: 'Hawaii Standard Time', value: 'hst' },
],
},
{
group: 'Europe & Africa',
options: [
{ label: 'Greenwich Mean Time', value: 'gmt' },
{ label: 'Central European Time', value: 'cet' },
{ label: 'Eastern European Time', value: 'eet' },
{ label: 'Western European Summer Time', value: 'west' },
{ label: 'Central Africa Time', value: 'cat' },
{ label: 'East Africa Time', value: 'eat' },
],
},
{
group: 'Asia',
options: [
{ label: 'Moscow Time', value: 'msk' },
{ label: 'India Standard Time', value: 'ist' },
{ label: 'China Standard Time', value: 'cst_china' },
{ label: 'Japan Standard Time', value: 'jst' },
{ label: 'Korea Standard Time', value: 'kst' },
{ label: 'Indonesia Central Standard Time', value: 'ist_indonesia' },
],
},
{
group: 'Australia & Pacific',
options: [
{ label: 'Australian Western Standard Time', value: 'awst' },
{ label: 'Australian Central Standard Time', value: 'acst' },
{ label: 'Australian Eastern Standard Time', value: 'aest' },
{ label: 'New Zealand Standard Time', value: 'nzst' },
{ label: 'Fiji Time', value: 'fjt' },
],
},
{
group: 'South America',
options: [
{ label: 'Argentina Time', value: 'art' },
{ label: 'Bolivia Time', value: 'bot' },
{ label: 'Brasilia Time', value: 'brt' },
{ label: 'Chile Standard Time', value: 'clt' },
],
},
];
public readonly itemToString = (value: string) =>
this.timezones.flatMap((group) => group.options).find((option) => option.value === value)?.label || '';
}Disabled
import { Component } from '@angular/core';
import { HlmSelectImports } from '@spartan-ng/helm/select';
@Component({
selector: 'spartan-select-disabled-preview',
imports: [HlmSelectImports],
template: `
<hlm-select disabled>
<hlm-select-trigger class="w-56">
<hlm-select-value placeholder="Select a fruit" />
</hlm-select-trigger>
<hlm-select-content *hlmSelectPortal>
<hlm-select-group>
<hlm-select-label>Fruits</hlm-select-label>
@for (item of items; track item.value) {
<hlm-select-item [value]="item.value">{{ item.label }}</hlm-select-item>
}
</hlm-select-group>
</hlm-select-content>
</hlm-select>
`,
})
export class SelectDisabledPreview {
public readonly items = [
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Blueberry', value: 'blueberry' },
{ label: 'Grapes', value: 'grapes' },
{ label: 'Pineapple', value: 'pineapple' },
];
}Invalid
import { Component } from '@angular/core';
import { HlmFieldImports } from '@spartan-ng/helm/field';
import { HlmSelectImports } from '@spartan-ng/helm/select';
@Component({
selector: 'spartan-select-invalid-preview',
imports: [HlmSelectImports, HlmFieldImports],
template: `
<hlm-field forceInvalid class="w-56">
<label hlmFieldLabel for="select-invalid">Fruit</label>
<hlm-select>
<hlm-select-trigger forceInvalid buttonId="select-invalid" class="w-full">
<hlm-select-value placeholder="Select a fruit" />
</hlm-select-trigger>
<hlm-select-content *hlmSelectPortal>
<hlm-select-group>
<hlm-select-label>Fruits</hlm-select-label>
@for (item of items; track item.value) {
<hlm-select-item [value]="item.value">{{ item.label }}</hlm-select-item>
}
</hlm-select-group>
</hlm-select-content>
</hlm-select>
<hlm-field-error>Please select a fruit.</hlm-field-error>
</hlm-field>
`,
})
export class SelectInvalidPreview {
public readonly items = [
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Blueberry', value: 'blueberry' },
{ label: 'Grapes', value: 'grapes' },
{ label: 'Pineapple', value: 'pineapple' },
];
}Object values
import { Component } from '@angular/core';
import { HlmSelectImports } from '@spartan-ng/helm/select';
@Component({
selector: 'spartan-select-object-preview',
imports: [HlmSelectImports],
template: `
<hlm-select>
<hlm-select-trigger class="w-72">
<hlm-select-placeholder>Select a shipping method</hlm-select-placeholder>
<ng-template hlmSelectValueTemplate let-value>
<div class="flex items-baseline gap-0.5">
<span>{{ value.name }}</span>
<span class="text-muted-foreground text-xs">({{ value.price }})</span>
</div>
</ng-template>
</hlm-select-trigger>
<hlm-select-content *hlmSelectPortal>
<hlm-select-group>
@for (method of shippingMethods; track method.id) {
<hlm-select-item [value]="method">
<div class="flex flex-col gap-0.5">
<div class="flex items-baseline gap-0.5">
<span>{{ method.name }}</span>
<span class="text-muted-foreground text-xs">({{ method.price }})</span>
</div>
<span class="text-muted-foreground text-xs">{{ method.duration }}</span>
</div>
</hlm-select-item>
}
</hlm-select-group>
</hlm-select-content>
</hlm-select>
`,
})
export class SelectObjectPreview {
public readonly shippingMethods = [
{
id: 'standard',
name: 'Standard',
duration: 'Delivers in 4-6 business days',
price: '$4.99',
},
{
id: 'express',
name: 'Express',
duration: 'Delivers in 2-3 business days',
price: '$9.99',
},
{
id: 'overnight',
name: 'Overnight',
duration: 'Delivers next business day',
price: '$19.99',
},
];
}Placeholder
Use hlm-select-placeholder to display a custom placeholder when no value is selected. If you only display a text as placeholder, you can also use the placeholder input on hlm-select-value .
import { Component } from '@angular/core';
import { NgIcon, provideIcons } from '@ng-icons/core';
import { lucideCitrus } from '@ng-icons/lucide';
import { HlmSelectImports } from '@spartan-ng/helm/select';
@Component({
selector: 'spartan-select-placeholder-preview',
imports: [HlmSelectImports, NgIcon],
providers: [provideIcons({ lucideCitrus })],
template: `
<hlm-select>
<hlm-select-trigger class="w-56">
<hlm-select-placeholder>
<ng-icon name="lucideCitrus" />
Select a fruit
</hlm-select-placeholder>
<hlm-select-value />
</hlm-select-trigger>
<hlm-select-content *hlmSelectPortal>
<hlm-select-group>
<hlm-select-label>Fruits</hlm-select-label>
@for (fruit of fruits; track fruit.value) {
<hlm-select-item [value]="fruit">{{ fruit.label }}</hlm-select-item>
}
</hlm-select-group>
</hlm-select-content>
</hlm-select>
`,
})
export class SelectPlaceholderPreview {
public readonly fruits = [
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Blueberry', value: 'blueberry' },
{ label: 'Grapes', value: 'grapes' },
{ label: 'Pineapple', value: 'pineapple' },
];
}Form
import { Component, signal } from '@angular/core';
import { form, FormField, FormRoot, required } from '@angular/forms/signals';
import { HlmButtonImports } from '@spartan-ng/helm/button';
import { HlmFieldImports } from '@spartan-ng/helm/field';
import { HlmSelectImports } from '@spartan-ng/helm/select';
@Component({
selector: 'spartan-select-form-preview',
imports: [HlmFieldImports, HlmSelectImports, HlmButtonImports, FormRoot, FormField],
host: {
class: 'w-full max-w-xs',
},
template: `
<form [formRoot]="form">
<hlm-field-group>
<hlm-field>
<label hlmFieldLabel for="fruit">Fruit</label>
<hlm-select [formField]="form.fruit" [itemToString]="itemToString">
<hlm-select-trigger buttonId="fruit" class="w-56">
<hlm-select-value placeholder="Select a fruit" />
</hlm-select-trigger>
<hlm-select-content *hlmSelectPortal>
<hlm-select-group>
<hlm-select-label>Fruits</hlm-select-label>
@for (item of items; track item.value) {
<hlm-select-item [value]="item.value">{{ item.label }}</hlm-select-item>
}
</hlm-select-group>
</hlm-select-content>
</hlm-select>
</hlm-field>
<hlm-field orientation="horizontal">
<button type="submit" hlmBtn>Submit</button>
</hlm-field>
</hlm-field-group>
</form>
`,
})
export class SelectFormPreview {
protected readonly _model = signal<{ fruit: string | null }>({ fruit: null });
public readonly form = form(
this._model,
(schemaPath) => {
required(schemaPath.fruit, { message: 'Please select a fruit' });
},
{
submission: {
action: async () => {
const model = this._model();
console.log(model);
},
},
},
);
public readonly items = [
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Blueberry', value: 'blueberry' },
{ label: 'Grapes', value: 'grapes' },
{ label: 'Pineapple', value: 'pineapple' },
];
public readonly itemToString = (value: string) => this.items.find((item) => item.value === value)?.label || '';
}RTL
To enable RTL support in spartan-ng, see the RTL configuration guide.
import { Component, computed, inject } from '@angular/core';
import { TranslateService, Translations } from '@spartan-ng/app/app/shared/translate.service';
import { HlmSelectImports } from '@spartan-ng/helm/select';
@Component({
selector: 'spartan-select-rtl',
imports: [HlmSelectImports],
template: `
<hlm-select [attr.dir]="_dir()" [itemToString]="itemToString">
<hlm-select-trigger class="w-32">
<hlm-select-value [placeholder]="_t()['selectFruit']" />
</hlm-select-trigger>
<hlm-select-content *hlmSelectPortal [attr.dir]="_dir()">
<hlm-select-group>
<hlm-select-label>{{ _t()['fruits'] }}</hlm-select-label>
@for (fruit of _fruits(); track fruit.value) {
<hlm-select-item [value]="fruit.value">{{ fruit.label }}</hlm-select-item>
}
</hlm-select-group>
<hlm-select-separator />
<hlm-select-group>
<hlm-select-label>{{ _t()['vegetables'] }}</hlm-select-label>
@for (vegetable of _vegetables(); track vegetable.value) {
<hlm-select-item [value]="vegetable.value">{{ vegetable.label }}</hlm-select-item>
}
</hlm-select-group>
</hlm-select-content>
</hlm-select>
`,
})
export class SelectRtlPreview {
public readonly fruits = ['apple', 'banana', 'blueberry', 'grapes', 'pineapple'];
public readonly vegetables = ['carrot', 'broccoli', 'spinach'];
private readonly _language = inject(TranslateService).language;
private readonly _translations: Translations = {
en: {
dir: 'ltr',
values: {
selectFruit: 'Select a fruit',
fruits: 'Fruits',
apple: 'Apple',
banana: 'Banana',
blueberry: 'Blueberry',
grapes: 'Grapes',
pineapple: 'Pineapple',
vegetables: 'Vegetables',
carrot: 'Carrot',
broccoli: 'Broccoli',
spinach: 'Spinach',
},
},
ar: {
dir: 'rtl',
values: {
selectFruit: 'اختر فاكهة',
fruits: 'الفواكه',
apple: 'تفاح',
banana: 'موز',
blueberry: 'توت أزرق',
grapes: 'عنب',
pineapple: 'أناناس',
vegetables: 'الخضروات',
carrot: 'جزر',
broccoli: 'بروكلي',
spinach: 'سبانخ',
},
},
he: {
dir: 'rtl',
values: {
selectFruit: 'בחר פרי',
fruits: 'פירות',
apple: 'תפוח',
banana: 'בננה',
blueberry: 'אוכמניה',
grapes: 'ענבים',
pineapple: 'אננס',
vegetables: 'ירקות',
carrot: 'גזר',
broccoli: 'ברוקולי',
spinach: 'תרד',
},
},
};
private readonly _translation = computed(() => this._translations[this._language()]);
protected readonly _t = computed(() => this._translation().values);
protected readonly _dir = computed(() => this._translation().dir);
protected readonly _fruits = computed(() => this.fruits.map((value) => ({ value, label: this._t()[value] })));
protected readonly _vegetables = computed(() => this.vegetables.map((value) => ({ value, label: this._t()[value] })));
protected readonly _allItems = computed(() => [...this._fruits(), ...this._vegetables()]);
public readonly itemToString = (value: string) =>
this._allItems().find((item) => item.value === value)?.label ?? value;
}Brain API
BrnSelectContent
Selector: [brnSelectContent]
ExportAs: brnSelectContent
BrnSelectGroup
Selector: [brnSelectGroup]
ExportAs: brnSelectGroup
BrnSelectItem
Selector: [brnSelectItem]
ExportAs: brnSelectItem
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | `brn-select-item-${++BrnSelectItem._id}` | A unique id for the item |
| value* (required) | T | - | The value this item represents. |
| disabled | boolean | false | - |
BrnSelectLabel
Selector: [brnSelectLabel]
ExportAs: brnSelectLabel
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | `brn-select-label-${++BrnSelectLabel._id}` | - |
BrnSelectList
Selector: [brnSelectList]
ExportAs: brnSelectList
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | `brn-select-list-${++BrnSelectList._id}` | The id of the select list |
BrnSelectMultiple
Selector: [brnSelectMultiple]
ExportAs: brnSelectMultiple
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| disabled | boolean | false | Whether the combobox is disabled |
| isItemEqualToValue | SelectItemEqualToValue<T> | this._config.isItemEqualToValue | A function to compare an item with the selected value. |
| itemToString | SelectItemToString<T> | undefined | this._config.itemToString | A function to convert an item to a string for display. |
| value | T[] | undefined | null | null | The selected value of the select. |
Outputs
| Prop | Type | Default | Description |
|---|---|---|---|
| valueChange | T[] | undefined | null | null | The selected value of the select. |
BrnSelectPlaceholder
Selector: [brnSelectPlaceholder]
ExportAs: brnSelectPlaceholder
BrnSelectScrollDown
Selector: [brnSelectScrollDown]
ExportAs: brnSelectScrollDown
BrnSelectScrollUp
Selector: [brnSelectScrollUp]
ExportAs: brnSelectScrollUp
BrnSelectSeparator
Selector: [brnSelectSeparator]
ExportAs: brnSelectSeparator
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | 'horizontal' | 'vertical' | 'horizontal' | - |
BrnSelectTrigger
Selector: button[brnSelectTrigger]
ExportAs: brnSelectTrigger
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | `brn-select-trigger-${++BrnSelectTrigger._id}` | - |
| forceInvalid | boolean | false | Whether to force the trigger into an invalid state. |
| aria-invalid | boolean | undefined | undefined | Manual override for aria-invalid. When not set, auto-detects from the parent autocomplete error state. |
BrnSelectValueTemplate
Selector: [brnSelectValueTemplate]
ExportAs: brnSelectValueTemplate
BrnSelectValue
Selector: [brnSelectValue]
ExportAs: brnSelectValue
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| placeholder | string | '' | - |
BrnSelectValues
Selector: [brnSelectValues]
ExportAs: brnSelectValues
BrnSelect
Selector: [brnSelect]
ExportAs: brnSelect
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| disabled | boolean | false | Whether the select is disabled |
| isSingleValuePresent | (value: T | undefined | null) => boolean | this._config.isSingleValuePresent | Determines whether a single value is present (i.e., has been selected). Considers `undefined`, `null`, and empty string as "not present". Only used by single select, ignored by the multiple select variant. |
| isItemEqualToValue | SelectItemEqualToValue<T> | this._config.isItemEqualToValue | A function to compare an item with the selected value. |
| itemToString | SelectItemToString<T> | undefined | this._config.itemToString | A function to convert an item to a string for display. |
| value | T | undefined | null | null | The selected value of the select. |
Outputs
| Prop | Type | Default | Description |
|---|---|---|---|
| valueChange | T | undefined | null | null | The selected value of the select. |
Helm API
HlmSelectContent
Selector: hlm-select-content
ExportAs: hlmSelectContent
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| showScroll | boolean | false | - |
HlmSelectGroup
Selector: [hlmSelectGroup],hlm-select-group
ExportAs: hlmSelectGroup
HlmSelectItem
Selector: hlm-select-item
ExportAs: hlmSelectItem
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | `brn-select-item-${++BrnSelectItem._id}` | A unique id for the item |
| disabled | boolean | false | - |
| value* (required) | T | - | The value this item represents. |
HlmSelectLabel
Selector: [hlmSelectLabel],hlm-select-label
ExportAs: hlmSelectLabel
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | `brn-select-label-${++BrnSelectLabel._id}` | - |
HlmSelectMultiple
Selector: [hlmSelectMultiple],hlm-select-multiple
ExportAs: hlmSelectMultiple
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| disabled | boolean | false | Whether the combobox is disabled |
| value | T[] | undefined | null | null | The selected value of the select. |
| isItemEqualToValue | SelectItemEqualToValue<T> | this._config.isItemEqualToValue | A function to compare an item with the selected value. |
| itemToString | SelectItemToString<T> | undefined | this._config.itemToString | A function to convert an item to a string for display. |
| align | BrnPopoverAlign | this._config.align | - |
| closeOnOutsidePointerEvents | boolean | this._defaultOptions.closeOnOutsidePointerEvents | - |
| sideOffset | number | this._config.sideOffset | - |
| state | BrnOverlayState | null | null | - |
| offsetX | number | this._config.offsetX | - |
| scrollStrategy | BrnOverlayOptions['scrollStrategy'] | 'close' | 'reposition' | null | this._defaultOptions.scrollStrategy | - |
Outputs
| Prop | Type | Default | Description |
|---|---|---|---|
| valueChange | T[] | undefined | null | - | The selected value of the select. |
| stateChanged | BrnOverlayState | - | - |
| closed | TResult | - | - |
HlmSelectPlaceholder
Selector: [hlmSelectPlaceholder],hlm-select-placeholder
ExportAs: hlmSelectPlaceholder
HlmSelectPortal
Selector: [hlmSelectPortal]
ExportAs: hlmSelectPortal
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| context | T | undefined | undefined | - |
| class | string | null | undefined | undefined | - |
HlmSelectScrollDown
Selector: hlm-select-scroll-down
ExportAs: hlmSelectScrollDown
HlmSelectScrollUp
Selector: hlm-select-scroll-up
ExportAs: hlmSelectScrollUp
HlmSelectSeparator
Selector: [hlmSelectSeparator],hlm-select-separator
ExportAs: hlmSelectSeparator
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | 'horizontal' | 'vertical' | 'horizontal' | - |
HlmSelectTrigger
Selector: hlm-select-trigger
ExportAs: hlmSelectTrigger
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| class | ClassValue | '' | - |
| buttonId | string | `hlm-select-trigger-${HlmSelectTrigger._id++}` | - |
| size | 'default' | 'sm' | 'default' | - |
| forceInvalid | boolean | false | Whether to force the trigger into an invalid state. |
| aria-invalid | boolean | undefined | undefined | Manual override for aria-invalid. When not set, auto-detects from the parent autocomplete error state. |
HlmSelectValueTemplate
Selector: [hlmSelectValueTemplate]
ExportAs: hlmSelectValueTemplate
HlmSelectValue
Selector: [hlmSelectValue],hlm-select-value
ExportAs: hlmSelectValue
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| placeholder | string | '' | - |
HlmSelectValuesContent
Selector: [hlmSelectValuesContent],hlm-select-values-content
ExportAs: hlmSelectValuesContent
HlmSelectValues
Selector: [hlmSelectValues]
ExportAs: hlmSelectValues
HlmSelect
Selector: [hlmSelect],hlm-select
ExportAs: hlmSelect
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| disabled | boolean | false | Whether the select is disabled |
| value | T | undefined | null | null | The selected value of the select. |
| isItemEqualToValue | SelectItemEqualToValue<T> | this._config.isItemEqualToValue | A function to compare an item with the selected value. |
| itemToString | SelectItemToString<T> | undefined | this._config.itemToString | A function to convert an item to a string for display. |
| align | BrnPopoverAlign | this._config.align | - |
| closeOnOutsidePointerEvents | boolean | this._defaultOptions.closeOnOutsidePointerEvents | - |
| sideOffset | number | this._config.sideOffset | - |
| state | BrnOverlayState | null | null | - |
| offsetX | number | this._config.offsetX | - |
| scrollStrategy | BrnOverlayOptions['scrollStrategy'] | 'close' | 'reposition' | null | this._defaultOptions.scrollStrategy | - |
Outputs
| Prop | Type | Default | Description |
|---|---|---|---|
| valueChange | T | undefined | null | - | The selected value of the select. |
| stateChanged | BrnOverlayState | - | - |
| closed | TResult | - | - |
On This Page