Components

Button

Primary, secondary or text action with an optional leading icon.

Accessibility role
button
Examples
17
Source
button.dsf:7: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"

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

API

Properties

NameTypeDefaultBindingDescription
labelstringrequiredinputVisible text. Also the accessible name.
disabledbooleanfalseinput—

Variants

NameValuesDefault
appearanceprimary, secondary, textprimary

States

NameTypeDefaultInteraction
hoveredbooleanfalsehover
pressedbooleanfalsepress
focus_visiblebooleanfalsefocus_visible

Slots

NameCardinalityAccepts
leadingoptionalicon

Events

NamePayload
activate—

Accessibility

AttributeValue
rolebutton
disabledprop.disabled
nameprop.label

Anatomy

Examples

activation-emits-activate

Verified by the reference semantics

Configuration

Properties
  • label = "Continue"

Inputs

  1. activation

Expectations

Events emitted: activate

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

button-minimum-size-and-box

Verified by the reference semantics

Configuration

Properties
  • label = "OK"

Expectations

Present: root, label

Node values

NodeAttributeExpected value
rootmin_widthdp(144)
rootmin_heightdp(51)
rootgapdp(8)
rootradiusdp(0)
rootpadding{ top = dp(13), end = dp(32), bottom = dp(12), start = dp(32) }
labeltypography{ font_family = ["Audi Type Wide", "Verdana", "sans-serif"], font_size = dp(15), font_weight = 400, letter_spacing = dp(0), line_height = 1.6 }
OK
Static preview computed from the reference semantics; native targets render with platform controls.

disabled-cannot-activate

Verified by the reference semantics

Configuration

Properties
  • disabled = true
  • label = "Continue"

Inputs

  1. activation
  2. activation

Expectations

Events emitted: none

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

disabled-wins-over-hover-press-and-focus

Verified by the reference semantics

Configuration

Properties
  • disabled = true
  • label = "Continue"
States
  • focus_visible = true
  • hovered = true
  • pressed = true

Expectations

Node values

NodeAttributeExpected value
rootopacity0.3
rootbackgroundhex("#000000")
rootforegroundcolor("srgb", [1, 1, 1], 0.5)
rootshadowstoken.shadow.none
Continue
Static preview computed from the reference semantics; native targets render with platform controls.

focus-visible-shows-the-legacy-glow

Verified by the reference semantics

Configuration

Properties
  • label = "Continue"
States
  • focus_visible = true

Expectations

Node values

NodeAttributeExpected value
rootshadows[{ blur = dp(3), color = color("srgb", [0, 0, 0], 0.1), offset_x = dp(0), offset_y = dp(0), spread = dp(3) }]
Continue
Static preview computed from the reference semantics; native targets render with platform controls.

hover-hides-the-focus-glow

Verified by the reference semantics

Configuration

Properties
  • label = "Continue"
States
  • focus_visible = true
  • hovered = true

Expectations

Node values

NodeAttributeExpected value
rootbackgroundhex("#333333")
rootshadowstoken.shadow.none
Continue
Static preview computed from the reference semantics; native targets render with platform controls.

primary-dark

Verified by the reference semantics

Configuration

Properties
  • label = "Continue"
Context
  • theme = "dark"

Expectations

Node values

NodeAttributeExpected value
rootbackgroundhex("#ffffff")
rootforegroundhex("#000000")
Continue
Static preview computed from the reference semantics; native targets render with platform controls.

primary-hover-light

Verified by the reference semantics

Configuration

Properties
  • label = "Continue"
States
  • hovered = true

Expectations

Node values

NodeAttributeExpected value
rootbackgroundhex("#333333")
Continue
Static preview computed from the reference semantics; native targets render with platform controls.

primary-light

Verified by the reference semantics

Configuration

Properties
  • label = "Continue"

Expectations

Node values

NodeAttributeExpected value
rootbackgroundhex("#000000")
rootforegroundhex("#ffffff")
Continue
Static preview computed from the reference semantics; native targets render with platform controls.

primary-press-dark

Verified by the reference semantics

Configuration

Properties
  • label = "Continue"
States
  • pressed = true
Context
  • theme = "dark"

Expectations

Node values

NodeAttributeExpected value
rootbackgroundhex("#e5e5e5")
Continue
Static preview computed from the reference semantics; native targets render with platform controls.

reduced-motion-is-instant

Verified by the reference semantics

Configuration

Properties
  • label = "Continue"
Context
  • reduced_motion = true

Expectations

Node values

NodeAttributeExpected value
roottransitions{ background = token.motion.transition.instant, border = token.motion.transition.instant, foreground = token.motion.transition.instant, opacity = token.motion.transition.instant, shadows = token.motion.transition.instant }
Continue
Static preview computed from the reference semantics; native targets render with platform controls.

secondary-dark

Verified by the reference semantics

Configuration

Properties
  • label = "Back"
Variants
  • appearance = "secondary"
Context
  • theme = "dark"

Expectations

Node values

NodeAttributeExpected value
rootforegroundhex("#ffffff")
rootborder{ color = hex("#ffffff"), style = "solid", width = dp(1) }
Back
Static preview computed from the reference semantics; native targets render with platform controls.

secondary-hover-dark

Verified by the reference semantics

Configuration

Properties
  • label = "Back"
Variants
  • appearance = "secondary"
States
  • hovered = true
Context
  • theme = "dark"

Expectations

Node values

NodeAttributeExpected value
rootforegroundhex("#e5e5e5")
rootborder{ color = hex("#cccccc"), style = "solid", width = dp(1) }
Back
Static preview computed from the reference semantics; native targets render with platform controls.

secondary-hover-light

Verified by the reference semantics

Configuration

Properties
  • label = "Back"
Variants
  • appearance = "secondary"
States
  • hovered = true

Expectations

Node values

NodeAttributeExpected value
rootforegroundhex("#4c4c4c")
rootborder{ color = hex("#808080"), style = "solid", width = dp(1) }
Back
Static preview computed from the reference semantics; native targets render with platform controls.

secondary-light

Verified by the reference semantics

Configuration

Properties
  • label = "Back"
Variants
  • appearance = "secondary"

Expectations

Node values

NodeAttributeExpected value
rootbackgroundcolor("srgb", [0, 0, 0], 0)
rootforegroundhex("#000000")
rootborder{ color = hex("#000000"), style = "solid", width = dp(1) }
Back
Static preview computed from the reference semantics; native targets render with platform controls.

text-dark

Verified by the reference semantics

Configuration

Properties
  • label = "Details"
Variants
  • appearance = "text"
Context
  • theme = "dark"

Expectations

Node values

NodeAttributeExpected value
rootforegroundhex("#ffffff")
rootborder{ color = color("srgb", [0, 0, 0], 0), style = "solid", width = dp(1) }
Details
Static preview computed from the reference semantics; native targets render with platform controls.

text-light-and-hover

Verified by the reference semantics

Configuration

Properties
  • label = "Details"
Variants
  • appearance = "text"
States
  • hovered = true

Expectations

Node values

NodeAttributeExpected value
rootmin_widthdp(0)
rootbackgroundcolor("srgb", [0, 0, 0], 0)
rootforegroundhex("#4c4c4c")
rootpadding{ top = dp(13), end = dp(0), bottom = dp(12), start = dp(0) }
Details
Static preview computed from the reference semantics; native targets render with platform controls.