Components

Checkbox

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

Accessibility role
checkbox
Examples
9
Source
checkbox.dsf:5: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—

States

NameTypeDefaultInteraction
hoveredbooleanfalsehover
pressedbooleanfalsepress
focus_visiblebooleanfalsefocus_visible

Events

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

Accessibility

AttributeValue
rolecheckbox
checkedprop.checked
disabledprop.disabled
nameprop.label

Anatomy

Examples

checkbox-checked-dark

Verified by the reference semantics

Configuration

Properties
  • checked = "checked"
  • label = "Show hidden files"
Context
  • theme = "dark"

Expectations

Present: checkmark

Absent: square

Node values

NodeAttributeExpected value
indicatorbackgroundhex("#479ef5")
indicatorforegroundhex("#242424")
checkmarksizedp(12)
Show hidden files
Static preview computed from the reference semantics; native targets render with platform controls.

checkbox-checked-light-hover

Verified by the reference semantics

Configuration

Properties
  • checked = "checked"
  • label = "Show hidden files"
States
  • hovered = true

Expectations

Node values

NodeAttributeExpected value
indicatorbackgroundhex("#115ea3")
indicatorforegroundhex("#ffffff")
Show hidden files
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 = "Show hidden files"

Inputs

  1. activation

Expectations

Events emitted: change

Present: checkmark

Show hidden files
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-dark

Verified by the reference semantics

Configuration

Properties
  • checked = "checked"
  • disabled = true
  • label = "Select all"
States
  • hovered = true
  • pressed = true
Context
  • theme = "dark"

Inputs

  1. activation

Expectations

Events emitted: none

Node values

NodeAttributeExpected value
indicatorbackgroundcolor("srgb", [0, 0, 0], 0)
indicatorforegroundhex("#5c5c5c")
indicatorborder{ color = hex("#424242"), style = "solid", width = dp(1) }
labelcolorhex("#5c5c5c")
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-outline

Verified by the reference semantics

Configuration

Properties
  • checked = "unchecked"
  • label = "Show hidden files"
States
  • focus_visible = true

Expectations

Node values

NodeAttributeExpected value
rootradiusdp(4)
rootoutline{ color = hex("#000000"), style = "solid", width = dp(2) }
Show hidden files
Static preview computed from the reference semantics; native targets render with platform controls.

checkbox-mixed-light

Verified by the reference semantics

Configuration

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

Expectations

Present: square

Absent: checkmark

Node values

NodeAttributeExpected value
indicatorbackgroundcolor("srgb", [0, 0, 0], 0)
indicatorforegroundhex("#0f6cbd")
Select all
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: square

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 = "Show hidden files"

Expectations

Present: root, indicator, label

Absent: checkmark, square

Node values

NodeAttributeExpected value
rootgapdp(12)
indicatorwidthdp(16)
indicatorheightdp(16)
indicatorradiusdp(2)
indicatorborder{ color = hex("#616161"), style = "solid", width = dp(1) }
labelcolorhex("#616161")
Show hidden files
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 = "Show hidden files"

Inputs

  1. activation

Expectations

Events emitted: change

Absent: checkmark, square

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