Skip to content

Add PreviewProvider support #1157

Closed

Description

@Kyle-Ye

Summary

Add PreviewProvider and its related preview APIs so that tools can discover and render previews declared with this protocol.

Scope

  • Add PreviewProvider, PreviewDevice, PreviewPlatform, PreviewContext, and InterfaceOrientation.
  • Add the preview modifiers, such as previewDevice(_:), previewLayout(_:), previewDisplayName(_:), previewInterfaceOrientation(_:), and previewContext(_:).
  • Expose _allPreviews metadata for preview tools.
  • Build and keep child view graphs for preview content.

Acceptance criteria

  • Each child of previews produces one preview with its name, layout, device, and orientation traits.
  • Preview tools can list the previews through _allPreviews.

API reference

Activity

  1. added this to the 0.24.0 milestone on Oct 16, 2026
  2. added
    type: feature
    area: view
    area: tooling
    on Oct 16, 2026
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: toolingarea: viewtype: feature

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions