Checkbox
Checkbox
is a single check box.
Basic Usage
import { Checkbox, Utils } from 'tuya-panel-kit'const { convertX: cx } = Utils.RatioUtils;const [checked, setChecked] = React.useState(false);<Checkboxcolor="#F84803"checked={checked.checked1}onChange={value => setChecked({ checked1: value })}>Checkbox1</Checkbox><Checkboxcolor="#F84803"checked={checked.checked2}style={{ marginTop: cx(8) }}onChange={value => setChecked({ checked2: value })}>Checkbox2</Checkbox>
disable status
import { Checkbox, Utils } from 'tuya-panel-kit'const { convertX: cx } = Utils.RatioUtils;<Checkbox color="red" checked={true} disabled={true}>Checkbox</Checkbox><Checkbox checked={false} disabled={true} style={{ marginTop: cx(8) }}>Checkbox</Checkbox>
Custom color and size
import { Checkbox, Utils } from 'tuya-panel-kit'const { convertX: cx } = Utils.RatioUtils;const [checked, setChecked] = React.useState(false);<Checkboxsize={cx(22)}color="#3BEB56"checked={checked.checked1}onChange={value => setChecked({ checked1: value })}>Checkbox1</Checkbox><Checkboxsize={cx(22)}color="#3BEB56"checked={checked.checked2}style={{ marginTop: cx(8) }}onChange={value => setChecked({ checked2: value })}>Checkbox2</Checkbox>