Select โ
...
Browser support โ
...
Parameters โ
The Web component uses a <z-select>
tag.
The parametrization of the component can be done with the following custom HTML params:
Name | Type | Description |
---|---|---|
config | string | The main parameter has two components following the pattern:
|
label | string | Label of the input |
readonly | boolean? | Transforms the input into an output |
value | string? | Value of the model |
disabled | boolean? | Blocks the interaction with the input component. |
required | boolean? | Marks the input component as required. |
name | string? | Identification for the field inside the form |
invalid | boolean? | The forced state for set the input as invalid |
help-text | string? | The forced message to be shown under the input |
The events emitted from the component are:
Name | Payload | Description |
---|---|---|
onchange | string | Returns the new value of the "value" attribute |
Playground โ
Customization โ
HTML Examples โ
Imports
html
<link rel="stylesheet" href="/0.3.6/@zurich/web-components/styles.css" />
<script type="module" src="/0.3.6/@zurich/web-components/select.js"></script>
Code
html
<z-select label="Input label"
options='[{ "text": "Option A", "value": "a" },{ "text": "Option B", "value": "b" },{ "text": "Option C", "value": "c", "disabled": true},{ "text": "Option D", "value": "d" }]'>
</z-select>