Skip to content

Add Label support #1023

Description

@Kyle-Ye

Summary

Add public Label support for pairing a title with an icon in a style-aware view.

Scope

  • Add the generic Label API with title and icon builders.
  • Add common Text and Image convenience initializers, including system-image and named-image forms.
  • Integrate LabelStyle, style configuration, .labelStyle(_:), and the automatic, title-and-icon, title-only, and icon-only styles.
  • Preserve the title and icon content when labels are composed inside controls and containers.
  • Add examples and focused coverage for custom and convenience-initialized labels.

Acceptance criteria

  • A custom Label { ... } icon: { ... } compiles and renders both components.
  • Label("Title", systemImage: "star") renders through the supported image backend.
  • Standard label styles select the expected title and icon content.
  • Label content remains available to enclosing controls and accessibility processing.

API reference

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: textText, labels, line style, and text rendering APIs.area: viewView APIs, modifiers, AnyView, ForEach, DynamicView, and related behavior.type: featureNew API, behavior, platform support, or user-facing capability.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions