Skip to main content

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:

NameDescriptionTypeDefault
labellabel of the checkboxString''
valueThe value of the checkboxstring''
checkedWhether the checkbox is checked or notbooleanfalse
disabledWhether the checkbox is disabled or notbooleanfalse

Events

NameDescriptionDetail
ty-changeFires when the checkbox is checked{ value: string }