# SiSelectSimpleOptionsDirective documentation

**Kind:** directive

**Selector:** `si-select[options]`

```
import { SiSelectSimpleOptionsDirective } from '@siemens/element-ng/select';
```

This directive allows passing [SelectItem](<index.html#t:SelectItem>) to the [SiSelectComponent](<../../components/SiSelectComponent/index.html#SiSelectComponent>).

Example:

```html
<si-select [options]="[{ type: 'option', value: 'one', label: 'One' }, { type: 'option', value: 'two', label: 'Two' }]"></si-select>
<si-select [options]="[{ type: 'group', label: 'Group', options [{ type: 'option', value: 1, label: 'One' }, { type: 'option', value: 2, label: 'Two' }] }]"></si-select>
```

```
directive SiSelectSimpleOptionsDirective<T = string> extends SiSelectOptionsStrategyBase<T>
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [optionEqualCheckFn](<https://github.com/siemens/element/blob/main/projects/element-ng/select/options/si-select-simple-options.directive.ts#L37-L40>) | `(a: T, b: T) => boolean` | `(a: T, b: T): boolean => a === b` | By default, values are check on referential equality. Provide a function to customize the behavior.<br><br>Inherited from `SiSelectOptionsStrategyBase<T>` |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/select/options/si-select-simple-options.directive.ts#L27-L27>) | `SelectItem<T>[] \| null \| undefined` |  | Options to be shown in select dropdown |

#### Attributes and Methods

##### allRows

[Source for allRows](<https://github.com/siemens/element/blob/main/projects/element-ng/select/options/si-select-simple-options.directive.ts#L42-L42>)

**Modifiers:** readonly

**Type:** `Signal<SelectItem<T>[]>`

**Default:** `computed(() => this.options() ?? [])`

All group and option items in the dropdown.

Inherited from `SiSelectOptionsStrategyBase<T>`

##### onFilter

[Source for onFilter](<https://github.com/siemens/element/blob/main/projects/element-ng/select/options/si-select-options-strategy.base.ts#L76-L78>)

**Modifiers:** inherited

This function is called when a user enters a filter query. It is expected that an implementation will update the `rows` based on the query.

Inherited from `SiSelectOptionsStrategyBase<T>`

Implements SiSelectOptionsStrategy\<T\>

```
onFilter(filterValue?: string): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [filterValue](<https://github.com/siemens/element/blob/main/projects/element-ng/select/options/si-select-options-strategy.base.ts#L76-L76>) (optional) | `string` |  | • Unprocessed input by user in the filterInput field |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### onValueChange

[Source for onValueChange](<https://github.com/siemens/element/blob/main/projects/element-ng/select/options/si-select-options-strategy.base.ts#L72-L74>)

**Modifiers:** inherited

Is always called when the value changes. The implementation must update [selectedRows](<index.html#SiSelectSimpleOptionsDirective.selectedRows>) when called.

Inherited from `SiSelectOptionsStrategyBase<T>`

Implements SiSelectOptionsStrategy\<T\>

```
onValueChange(value: T[]): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [value](<https://github.com/siemens/element/blob/main/projects/element-ng/select/options/si-select-options-strategy.base.ts#L72-L72>) | `T[]` |  | • currently selected value of the related si-select. |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### rows

[Source for rows](<https://github.com/siemens/element/blob/main/projects/element-ng/select/options/si-select-options-strategy.base.ts#L35-L62>)

**Modifiers:** readonly, inherited

**Type:** `Signal<SelectItem<T>[]>`

**Default:** `[]`

Rows that should be shown.

Inherited from `SiSelectOptionsStrategyBase<T>`

Implements SiSelectOptionsStrategy\<T\>

##### selectedRows

[Source for selectedRows](<https://github.com/siemens/element/blob/main/projects/element-ng/select/options/si-select-options-strategy.base.ts#L64-L70>)

**Modifiers:** readonly, inherited

**Type:** `Signal<SelectOption<T>[]>`

**Default:** `...`

List of all options that are currently selected. Must be updated when [onValueChange](<index.html#SiSelectSimpleOptionsDirective.onValueChange>) is called.

Inherited from `SiSelectOptionsStrategyBase<T>`

Implements SiSelectOptionsStrategy\<T\>

### Types Documentation

### [SelectItem](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L54-L54>)

**Kind:** type alias

```
import type { SelectItem } from '@siemens/element-ng/select';
```

Alias for [SelectOption](<index.html#t:SelectOption>) or [SelectGroup](<index.html#t:SelectGroup>)

```
type SelectItem<T> = SelectGroup<T> | SelectOption<T>
```

### [SelectOption](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L21-L51>)

**Kind:** interface

```
import type { SelectOption } from '@siemens/element-ng/select';
```

A select option

```
interface SelectOption<T>
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [disabled](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L32-L32>) (optional) | `boolean` | Whether this option is disabled. |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L34-L34>) (optional) | `string` | An optional icon. |
| [iconColor](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L36-L36>) (optional) | `string` | The color of an icon. |
| [label](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L45-L45>) (optional) | `TranslatableString` | A label to be shown for this option. Is optional if a custom template is provided or if the value should directly be rendered. |
| [stackedIcon](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L38-L38>) (optional) | `string` | An optional stacked icon. |
| [stackedIconColor](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L40-L40>) (optional) | `string` | The color of a stacked icon. |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L23-L23>) | `"option"` | Defines this to be an option. |
| [typeaheadLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L50-L50>) (optional) | `TranslatableString` | Used for typeahead functionality when filtering is disabled. If provided, this will be used, otherwise the innerText of the rendered element. |
| [value](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L30-L30>) | `T` | The value if this option. It will be used for formControls and the value property of this `si-select`. The value will internally be checked on equality by using `===`. So an app should either use `string` or ensure that same values are referentially equal. |

### [SelectGroup](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L8-L18>)

**Kind:** interface

```
import type { SelectGroup } from '@siemens/element-ng/select';
```

A select option group

```
interface SelectGroup<T>
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [key](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L12-L12>) (optional) | `string` | An optional key to identify this group in a custom template. |
| [label](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L14-L14>) (optional) | `TranslatableString` | A label to be shown as header for this group. Is optional if a custom template is provided. |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L17-L17>) | `SelectOption<T>[]` | All options that are part of this group. |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/select/si-select.types.ts#L10-L10>) | `"group"` | Defines this to be a group. |

### [TranslatableString](<https://github.com/siemens/element/blob/main/projects/element-translate-ng/translate-types/global.types.ts#L18-L18>)

**Kind:** type alias

```
import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';
```

Represents a translatable string. This can either be a translation key, e.g. `ACTIONS.EDIT` that will be automatically translated when displayed on the UI or a pre-translated string, e.g. `Edit`. Equivalent to a normal string in usage and functionality.

```
type TranslatableString = string & Translatable
```
