Checkbox

Tick one or several. A tick waits for Save; for something applied at once, use a Switch. On its own it is filled solid, so the mark reads in both themes. In a group it takes the same variants as a radio group: a list, rows, cards and chips.

A group

The top one stands for all: half ticked when some are.

<Checkbox label="Ammonium" bind:checked={ammonium} />

Checkbox group

Several options with one value, an array. Picked ones are tinted with the primary, as in a radio group.

Variant

["email"]

<CheckboxGroup variant="rows" bind:value>
	<CheckboxGroupItem value="email" label="Email" description="A summary when…" />
	<CheckboxGroupItem value="sms" label="SMS" />
	<CheckboxGroupItem value="webhook" label="Webhook" />
</CheckboxGroup>

Cards with images, and chips

Deliverables told apart by a picture, then an optional format as chips.

<CheckboxGroup variant="cards" bind:value={deliverables}>
	<CheckboxGroupItem value="depth" label="Depth map" description="With contours, as PDF or DWG" image={src} />
	…
</CheckboxGroup>

<CheckboxGroup variant="cards" columns="auto" bind:value={formats}>
	<CheckboxGroupItem value="pdf" label="PDF" />
	…
</CheckboxGroup>

Rules

  • The label is part of the hit area. Say what ticking it means, positively: "Send a copy", not "Don't send".
  • A list of options stacks vertically, 12px apart.
  • Options with a description, a picture or a price: a CheckboxGroup with rows or cards, the same as a radio group, so a form mixing both reads as one thing.
  • Applied at once, no Save: a Switch.