Velvet Thunder

Checkbox

Sizes

<DemoSpaceX>
  <VelvetCheckbox @isChecked={{true}} @size="sm">Small</VelvetCheckbox>
  <VelvetCheckbox @isChecked={{true}} @size="md">Medium</VelvetCheckbox>
  <VelvetCheckbox @isChecked={{true}} @size="lg">Large</VelvetCheckbox>
</DemoSpaceX>

Disabled

<DemoSpaceX>
  <VelvetCheckbox @isDisabled={{true}}>Disabled</VelvetCheckbox>
  <VelvetCheckbox @isChecked={{true}} @isDisabled={{true}}>
    Disabled
  </VelvetCheckbox>
</DemoSpaceX>

Indeterminate

<VelvetCheckbox @isIndeterminate={{true}}>Indeterminate</VelvetCheckbox>

Examples

Handle Change Events

Edit this demo

Use the @onChange argument to handle change events.

Checked: false
<DemoSpaceY>
  <div>Checked: {{this.isChecked}}</div>
  <VelvetCheckbox @isChecked={{this.isChecked}} @onChange={{this.onChange}}>
    Option
  </VelvetCheckbox>
</DemoSpaceY>

Signature

Element

HTMLInputElement

Blocks

NameDescriptionType
:default *The label of the checkbox.[]
Blocks marked with * are required.

Arguments

NameDescriptionTypeDefault Value
@isCheckedIndicate if the checkbox is checked.booleanfalse
@isDisabledIndicate if the checkbox is disabled.booleanfalse
@isIndeterminateIndicate if the checkbox is indeterminate.booleanfalse
@nameThe name of the checkbox.string""
@onChangeHandle the checkbox's `change` event.(value: boolean, event: Event) => voidundefined
@sizeThe size of the checkbox.Size"md"
Arguments marked with * are required.
Button
Checkbox Group