Components

Checkbox

Tri-state checkbox (unchecked, checked, mixed) with a controlled value.

Accessibility role
checkbox
Examples
10
Source
checkbox.dsf:6:1

Preview

Default configuration: every property, variant and state at its default, every context axis at its default.

Placeholder values for required properties: label = "Label", checked = "unchecked"

Label
Static preview computed from the reference semantics; native targets render with platform controls.

API

Properties

NameTypeDefaultBindingDescription
labelstringrequiredinputVisible text and accessible name.
checkedenum(["unchecked", "checked", "mixed"])requiredcontrolledHost-owned value. The component reads it and never assigns it.
disabledbooleanfalseinput—
invalidbooleanfalseinputShows the border, the tick and the label in signal red (A11 _checkbox.scss:133-146; A2's signal red replaces the legacy #bb0a30).

States

NameTypeDefaultInteraction
hoveredbooleanfalsehover
pressedbooleanfalsepress
focus_visiblebooleanfalsefocus_visible

Events

NamePayload
changevalue = enum(["unchecked", "checked"])

Accessibility

AttributeValue
rolecheckbox
checkedprop.checked
disabledprop.disabled
invalidprop.invalid
nameprop.label

Anatomy

Examples

checkbox-checked-dark-hover

Verified by the reference semantics

Configuration

Properties
  • checked = "checked"
  • label = "I accept the terms of use"
States
  • hovered = true
Context
  • theme = "dark"

Expectations

Present: check

Absent: dash

Node values

NodeAttributeExpected value
boxforegroundhex("#f2f2f2")
boxborder{ color = hex("#ffffff"), style = "solid", width = dp(1) }
checksizedp(12)
labelcolorhex("#ffffff")
I accept the terms of use
Static preview computed from the reference semantics; native targets render with platform controls.

checkbox-checked-requests-change

Verified by the reference semantics

Configuration

Properties
  • checked = "checked"
  • label = "I accept the terms of use"

Inputs

  1. activation

Expectations

Events emitted: change

Present: check

I accept the terms of use
Static preview computed from the reference semantics; native targets render with platform controls. The preview shows the configuration after the inputs or steps.

checkbox-disabled-blocks-activation-and-hover

Verified by the reference semantics

Configuration

Properties
  • checked = "mixed"
  • disabled = true
  • label = "Select all"
States
  • focus_visible = true
  • hovered = true

Inputs

  1. activation

Expectations

Events emitted: none

Node values

NodeAttributeExpected value
rootopacity0.3
boxshadowstoken.shadow.none
boxborder{ color = color("srgb", [0, 0, 0], 0.5), style = "solid", width = dp(1) }
Select all
Static preview computed from the reference semantics; native targets render with platform controls. The preview shows the configuration after the inputs or steps.

checkbox-focus-visible-dark

Verified by the reference semantics

Configuration

Properties
  • checked = "unchecked"
  • label = "I accept the terms of use"
States
  • focus_visible = true
Context
  • theme = "dark"

Expectations

Node values

NodeAttributeExpected value
boxshadows[{ blur = dp(3), color = color("srgb", [1, 1, 1], 0.2), offset_x = dp(0), offset_y = dp(0), spread = dp(3) }]
I accept the terms of use
Static preview computed from the reference semantics; native targets render with platform controls.

checkbox-hover-light

Verified by the reference semantics

Configuration

Properties
  • checked = "unchecked"
  • label = "I accept the terms of use"
States
  • hovered = true

Expectations

Node values

NodeAttributeExpected value
boxborder{ color = hex("#000000"), style = "solid", width = dp(1) }
labelcolorhex("#000000")
I accept the terms of use
Static preview computed from the reference semantics; native targets render with platform controls.

checkbox-invalid-dark

Verified by the reference semantics

Configuration

Properties
  • checked = "unchecked"
  • invalid = true
  • label = "I accept the terms of use"
Context
  • theme = "dark"

Expectations

Node values

NodeAttributeExpected value
boxborder{ color = hex("#fd2c4e"), style = "solid", width = dp(1) }
I accept the terms of use
Static preview computed from the reference semantics; native targets render with platform controls.

checkbox-invalid-uses-signal-red

Verified by the reference semantics

Configuration

Properties
  • checked = "checked"
  • invalid = true
  • label = "I accept the terms of use"
States
  • hovered = true

Expectations

Node values

NodeAttributeExpected value
boxforegroundhex("#eb0d3f")
boxborder{ color = hex("#eb0d3f"), style = "solid", width = dp(1) }
labelcolorhex("#eb0d3f")
I accept the terms of use
Static preview computed from the reference semantics; native targets render with platform controls.

checkbox-mixed-requests-change

Verified by the reference semantics

Configuration

Properties
  • checked = "mixed"
  • label = "Select all"

Inputs

  1. activation

Expectations

Events emitted: change

Present: dash

Select all
Static preview computed from the reference semantics; native targets render with platform controls. The preview shows the configuration after the inputs or steps.

checkbox-unchecked-light

Verified by the reference semantics

Configuration

Properties
  • checked = "unchecked"
  • label = "I accept the terms of use"

Expectations

Present: root, box, label

Absent: check, dash

Node values

NodeAttributeExpected value
rootgapdp(16)
boxwidthdp(24)
boxheightdp(24)
boxradiusdp(0)
boxborder{ color = color("srgb", [0, 0, 0], 0.5), style = "solid", width = dp(1) }
labelcolorhex("#333333")
labeltypography{ font_family = ["Audi Type Wide", "Verdana", "sans-serif"], font_size = dp(16), font_weight = 400, letter_spacing = dp(0), line_height = 1.5 }
I accept the terms of use
Static preview computed from the reference semantics; native targets render with platform controls.

checkbox-unchecked-requests-change

Verified by the reference semantics

Configuration

Properties
  • checked = "unchecked"
  • label = "I accept the terms of use"

Inputs

  1. activation

Expectations

Events emitted: change

Absent: check, dash

I accept the terms of use
Static preview computed from the reference semantics; native targets render with platform controls. The preview shows the configuration after the inputs or steps.