Skip to content

Checkbox

A control that allows the user to toggle between checked and not checked.

Example

import { UiLabel, UiCheckbox } from '@altdot/extension';
export default function Command() {
return (
<div style={{ display: 'flex', alignItems: 'center' }}>
<UiCheckbox id="accept" />
<UiLabel htmlFor="accept">Accept</UiLabel>
</div>
);
}

Props

NameTypeDescription
defaultChecked?(boolean | 'indeterminate')The checked state of the checkbox when it is initially rendered
checked?(boolean | 'indeterminate')Checked state of the checkbox
onCheckedChange?((value: boolean | 'indeterminate') => void)Fired when the checked state of the checkbox changes
disabled?booleanWhether to disable the checkbox