Skip to content

Select โ€‹

...

Browser support โ€‹

...

Parameters โ€‹

The Web component uses a <z-select> tag.

Hello

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescription
configstring

The main parameter has two components following the pattern: <shape><?:size>.

  • shape: Establishes the styling of the input. Default value is line . Possible values are: shaped or line. ,
  • size: (optional) defines de size of the input. The default value is m, being omitted from the param. The possible values are: m or l.
labelstringLabel of the input
readonlyboolean?Transforms the input into an output
valuestring?Value of the model
disabledboolean?Blocks the interaction with the input component.
requiredboolean?Marks the input component as required.
namestring?Identification for the field inside the form
invalidboolean?The forced state for set the input as invalid
help-textstring?The forced message to be shown under the input

The events emitted from the component are:

NamePayloadDescription
onchangestringReturns 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>