@cas-smartdesign/checkbox
v7.0.6
Published
A checkbox element which encloses the look and feel of the smartdesign checkbox
Readme
@cas-smartdesign/checkbox
A checkbox element based on lit-element with SmartDesign look & feel.
This element must be used together with the design tokens of SmartDesign. For an independent application, make sure to include the @cas-smartdesign/design-tokens package. For a web app / web widget, refer to the official documentation about design token usage.
Attributes
label: string- The label of the checkbox.
disabled: boolean- Defines whether if the checkbox is disabled. Note that it uses default disabled attribute, thus blocking pointer/mouse events.
checked: boolean- The value of the checkbox.
oneline: boolean- The label of the checkbox may wrap into multiple lines without this option.
Properties
label,disabled,checked,oneline- Reflects the corresponding attribute
indeterminateboolean (default=false)- Defines whether if the checkbox is in indeterminate state
- When either this or the
checkedproperty becomes true then the other one becomes false
- When either this or the
- Defines whether if the checkbox is in indeterminate state
CSS Custom Properties
--sd-checkbox-size- Defines the size of the checkbox, defaults to 20px
--sd-checkbox-label-gap-size- Defines the gap size between the checkbox and the label, defaults to 6px
--sd-checkbox-border-width- Defines the border width of the checkbox, defaults to 2px
--sd-checkbox-border-radius- Defines the border radius of the checkbox
--sd-checkbox-border-color- Defines the default border color of the checkbox, defaults to #999999
--sd-checkbox-background-color- Defines the default background of the checkbox, defaults to #FFFFFF
--sd-checkbox-checked-border-color- Defines the border color for the checked state, defaults to #1467BA
--sd-checkbox-checked-background-color- Defines the background color for the checked state, defaults to #1467BA
--sd-checkbox-indeterminate-border-color- Defines the border color for the indeterminate state, defaults to #1467BA
--sd-checkbox-indeterminate-background-color- Defines the background color for the indeterminate state, defaults to #1467BA
--sd-checkbox-disabled-border-color- Defines the border color for the disabled state, defaults to #C6C6C6, and to #E7E7E7 when checked or indeterminate
--sd-checkbox-disabled-background-color- Defines the background color for the disabled state, defaults to #E7E7E7
Custom events
sd-checkbox-value-change- This event is dispatched when the value is changed because of a user interaction
Validation
The element could show validation messages via an sd-field-validation-message element which can be configured with the following attributes & properties which are all delegated to that:
validationMessagevalidationIconSrcvalidationLevel
