Checkbox
Animated checkbox with an optional label and the control surface.
When to use
Use Checkbox when you need animated checkbox with an optional label and the control surface.
Import
TypeScript
import { Checkbox } from '@gzodo/ui'Use Checkbox for a single boolean. The whole row is a label, so clicking the text toggles the box. The check is an SVG stroke animation. For a group of choices, render several checkboxes.
Examples
5Basic
Controlled with
checked and onChange. The event is the native input change.Label position
labelPosition is right by default. left puts the text before the box.Ghost and transparent
ghost removes the padding of the control surface. transpared (CRM spelling) drops the background and border.Loading and disabled
Loading replaces the box with a spinner. Disabled blocks the toggle and mutes the label.
Sizes
Size changes the label font and the control height. The check glyph stays 12px.
Checkbox
12Checkbox
Property
Description
Type
Default
checkedControlled checked state.
boolean—
defaultCheckedUncontrolled initial state.
boolean—
onChangeNative change event. Read event.target.checked.
ChangeEventHandler—
labelText or node beside the box.
ReactNode—
labelPositionWhich side the label sits on.
'left' | 'right''right'sizeControl height and label size.
'sm' | 'md' | 'lg' | 'xl''md'variantSurface. Defaults to default, or ghost when ghost is set.
ControlVariant—
ghostZero padding. Also selects the ghost variant unless variant is set.
boolean—
transparedTransparent background and border. Spelling matches CRM.
boolean—
isLoadingReplaces the box with a spinner.
boolean—
disabledBlocks toggling.
boolean—
fullWidthStretch the row.
boolean—