Skip to content

Add Button support #1024

Closed
Closed

Description

@Kyle-Ye

Summary

Complete public Button support so buttons render their labels and invoke their actions through supported input mechanisms.

Scope

  • Complete the generic Button implementation and its common label, title, and role initializers.
  • Connect pointer or touch activation to the button action, including disabled-state handling.
  • Integrate ButtonStyle, PrimitiveButtonStyle, their configuration values, .buttonStyle(_:), and baseline default, plain, and borderless styles.
  • Propagate label, role, enabled, and pressed state through the style pipeline.
  • Add examples and focused coverage for rendering, activation, disabled buttons, roles, and custom styles.

Acceptance criteria

  • Button("Run") { ... } renders its label and invokes its action once per activation.
  • A disabled button does not invoke its action.
  • Custom button styles receive the expected label, role, and pressed state.
  • Primitive button styles can trigger the configured action.
  • Button activation participates in the supported host's normal focus and accessibility behavior.

API reference

Activity

  1. added
    type: feature
    area: event-gesture
    area: view
    on Aug 25, 2026
  2. Nexushunter commented on Sep 5, 2026

    @Nexushunter

    I can take this on! It looks like Toggle might be the best starting point for an example?

  3. self-assigned this
    on Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: event-gesturearea: viewtype: feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions