Skip to main content

Checkbox

A checkbox is an interactive element that allows users to select or deselect an option.

Example

Illustrates the animations that happen in the checkbox component. In this component we have animations on hover and active states as well as when the component is selected and unselected.

Three checkboxes in a horizontal row. First one in default state, second one in hover state and third one in checked state.

Hover

When the user hovers over an unselected checkbox, the hover state $hover-01 fades in at 200ms. When a user moves the mouse away the hover state $hover-01 fades out at 200ms.

A chart showing timing in milliseconds for hover 01 property.
PropertyCubic BezierEasing tokenNotes
Hover 01(.45, 0, .55, 1)$easing-functionalHover 01 opacity 0-100% at 200ms

Active

When the user clicks a checkbox, the active state $active-01 fades in at 100ms and then out at 100ms.

A chart showing timing in milliseconds for active 01 property.
PropertyCubic BezierEasing tokenNotes
Active 01(.45, 0, .55, 1)$easing-functionalActive 01 opacity 0-100% at 100ms

Selected

When a checkbox is selected the colour fill $interactive-brand scales from the centre 0-100% and the tick path animates in, both at 150ms.

A chart showing timing in milliseconds for tick and fill properties.
PropertyCubic BezierEasing tokenNotes
Tick(.45, 0, .55, 1)$easing-functionalPath animation at 150ms
Fill(.45, 0, .55, 1)$easing-functionalScales 0-100% at 150ms

Unselected

When a checkbox is unselected both the tick and the fill scale down 100-0% at 100ms.

A chart showing timing in milliseconds for tick and fill properties.
PropertyCubic BezierEasing tokenNotes
Tick(.45, 0, .55, 1)$easing-functionalScales 100-0% at 100ms
Fill(.45, 0, .55, 1)$easing-functionalScales 100-0% at 100ms