Skip to contentEnma

Components

Checkbox

Live demo

How to use it

A choice inside a form or list that is confirmed later, or a checklist item.

  • Provide label, and checked/onChange or defaultChecked.
  • The box border is --e-line-strong; checked fills with --e-primary.

Don't: use it for instant settings (use Switch).

In every theme

Follows the mode picked in the header.
Graphite
Glass
Paper
Mineral
Enamel
Ember

Code

React
import { Checkbox } from 'enma/react';

<Checkbox label="Warm-up done" defaultChecked />
Plain HTML
<label class="e-check">
  <input class="e-check__input" type="checkbox">
  <span class="e-check__box" aria-hidden="true"><!-- check icon --></span>
  <span>Warm-up done</span>
</label>

Props

CheckboxProps

Also accepts every attribute of React.InputHTMLAttributes<HTMLInputElement>.

Props of CheckboxProps
PropTypeDefaultDescription
labelReact.ReactNode

↑ ↓ to move, Enter to open, Esc to close

Keyboard shortcuts

Open the command palette
Ctrl then K
Search
/
Show keyboard shortcuts
?
Close the top overlay
Esc
Go to Home
G then H
Go to Themes
G then T
Go to Playground
G then P
Go to Components
G then C
Go to Guides
G then G
Go to Samples
G then S