Checkbox
The ty-checkbox is an advanced custom checkbox component designed with extensibility and customization in mind. It supports standard checkbox behaviors while offering additional features like custom events and a disabled state.
Usage
To use ty-checkbox, include it in your HTML code and specify its attributes for customization.
Live Editor
<ty-row> <ty-col sm="4" md="4" lg="4" xl="4"> <ty-checkbox name="option" value="a" label="A"> </ty-checkbox> </ty-col> <ty-col sm="4" md="4" lg="4" xl="4"> <ty-checkbox name="option" value="b" label="B"> </ty-checkbox> </ty-col> <ty-col sm="4" md="4" lg="4" xl="4"> <ty-checkbox name="option" value="c" label="C"> </ty-checkbox> </ty-col> </ty-row>
Result
Loading...
API
Properties
The ty-checkbox component accepts the following properties:
| Name | Description | Type | Default |
|---|---|---|---|
label | label of the checkbox | String | '' |
value | The value of the checkbox | string | '' |
checked | Whether the checkbox is checked or not | boolean | false |
disabled | Whether the checkbox is disabled or not | boolean | false |
Events
| Name | Description | Detail |
|---|---|---|
ty-change | Fires when the checkbox is checked | { value: string } |