Components

Button

Action with five appearances and an optional leading icon.

Accessibility role
button
Examples
16
Source
button.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"

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
appearancesecondary, primary, outline, subtle, transparentsecondary

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 = "Open"

Inputs

  1. activation

Expectations

Events emitted: activate

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

button-medium-geometry

Verified by the reference semantics

Configuration

Properties
  • label = "OK"

Expectations

Present: root, label

Node values

NodeAttributeExpected value
rootmin_widthdp(96)
rootmin_heightdp(32)
rootpaddinginsets(dp(5), dp(12))
rootgapdp(6)
rootradiusdp(4)
labeltypography{ font_family = ["Segoe UI", "Segoe UI Web (West European)", "-apple-system", "BlinkMacSystemFont", "Roboto", "Helvetica Neue", "sans-serif"], font_size = dp(14), font_weight = 600, letter_spacing = dp(0), line_height = 20 / 14 }
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 = "Open"

Inputs

  1. activation
  2. activation

Expectations

Events emitted: none

Open
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 = "Save"
Variants
  • appearance = "primary"
States
  • focus_visible = true
  • hovered = true
  • pressed = true

Expectations

Node values

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

focus-visible-ring-dark

Verified by the reference semantics

Configuration

Properties
  • label = "Open"
States
  • focus_visible = true
Context
  • theme = "dark"

Expectations

Node values

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

outline-dark-hover

Verified by the reference semantics

Configuration

Properties
  • label = "Share"
Variants
  • appearance = "outline"
States
  • hovered = true
Context
  • theme = "dark"

Expectations

Node values

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

outline-light

Verified by the reference semantics

Configuration

Properties
  • label = "Share"
Variants
  • appearance = "outline"

Expectations

Node values

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

primary-dark

Verified by the reference semantics

Configuration

Properties
  • label = "Save"
Variants
  • appearance = "primary"
Context
  • theme = "dark"

Expectations

Node values

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

primary-dark-pressed

Verified by the reference semantics

Configuration

Properties
  • label = "Save"
Variants
  • appearance = "primary"
States
  • pressed = true
Context
  • theme = "dark"

Expectations

Node values

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

primary-light-hover

Verified by the reference semantics

Configuration

Properties
  • label = "Save"
Variants
  • appearance = "primary"
States
  • hovered = true

Expectations

Node values

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

secondary-dark-pressed

Verified by the reference semantics

Configuration

Properties
  • label = "Open"
States
  • hovered = true
  • pressed = true
Context
  • theme = "dark"

Expectations

Node values

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

secondary-light

Verified by the reference semantics

Configuration

Properties
  • label = "Open"

Expectations

Node values

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

subtle-dark-pressed

Verified by the reference semantics

Configuration

Properties
  • label = "Filter"
Variants
  • appearance = "subtle"
States
  • hovered = true
  • pressed = true
Context
  • theme = "dark"

Expectations

Node values

NodeAttributeExpected value
rootbackgroundhex("#2e2e2e")
rootforegroundhex("#d6d6d6")
Filter
Static preview computed from the reference semantics; native targets render with platform controls.

subtle-light-hover

Verified by the reference semantics

Configuration

Properties
  • label = "Filter"
Variants
  • appearance = "subtle"
States
  • hovered = true

Expectations

Node values

NodeAttributeExpected value
rootbackgroundhex("#f5f5f5")
rootforegroundhex("#424242")
Filter
Static preview computed from the reference semantics; native targets render with platform controls.

transparent-dark-hover

Verified by the reference semantics

Configuration

Properties
  • label = "More"
Variants
  • appearance = "transparent"
States
  • hovered = true
Context
  • theme = "dark"

Expectations

Node values

NodeAttributeExpected value
rootbackgroundcolor("srgb", [0, 0, 0], 0)
rootforegroundhex("#ffffff")
More
Static preview computed from the reference semantics; native targets render with platform controls.

transparent-light

Verified by the reference semantics

Configuration

Properties
  • label = "More"
Variants
  • appearance = "transparent"

Expectations

Node values

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