Skip to content
Favorite
This is a help text This is a help text
BooleanIcon ⚠️ Experimental
The BooleanIcon component can be used imported from:
Common API
For the basics, check the common specifications.
Playground
Parameters
Events
This component has events. Check the documentation about how to use the events.
Name | Payload | Description |
---|---|---|
change | boolean | Returns the new value of the model |
restarted | void | Emitted on value reset |
blur | void | Emitted on blur |
validated | boolean | Emitted when the validation status changes |
Slots
This component has slots. Check the documentation about how to use the slots.
Name | Tags | Description |
---|---|---|
label | span | Label for the input |
help-text | span | Help message |
Parameters use
Check the documentation about how to use the parameters.
config
The config
attribute matches the config
parameter.
Required parameter
Since this is a required parameter, the component won't be displayed if it's not set.
label
The label
optional attribute matches the label
parameter and can be set using the label
attribute or the label
slot.
model
Attention!
If you hardcode this value, it will not be reactive and the selection won't change. Use a variable instead and, ideally, a closed loop.
It's used to set the value of the component and it's reactive.
name
The attribute name
will set the name of the component. This is useful when the component is part of a form.
help-text
The help-text
attribute will provide a text if a label
is used:
We can also use the help-text
slot:
Flags
checked
This flag is only used to set the initial value with no control loop. Use model
to handle the model properly:
disabled
The attribute disabled
will block the interaction with the component.
And with label:
required
The attribute required
will set the component as required.
The default text adapts to the localization:
invalid
The invalid
attribute will set the component as invalid. If a label is present a default text will be shown unless is overwritten using help-text
.
The default text adapts to the localization:
Methods
reset()
We can all the reset()
method of the WebComponent in order to reset the value. This will clean the internal states and emit the nullable value with the change
event, plus a restarted
event:
In this example, the button triggers the method:
Value:
false
Browser support
Detected engine:
Chromium
Webkit
Gecko