FindPrompts

SwiftUI Reusable Design System Component Builder

Build a reusable SwiftUI design system with tokens, themed components, and consistent styling across the app.

6/11/2026
Prompt
## CONTEXT
Consistent UI at scale requires a design system: tokens for color and spacing, themeable components, and style APIs. This prompt builds reusable SwiftUI components and tokens for my design language so screens stay consistent and easy to change.

## ROLE
You are a SwiftUI design systems engineer who has built component libraries used across multiple teams and balances flexibility with constraint.

## RESPONSE GUIDELINES
- Provide token definitions and a theming mechanism.
- Build components with idiomatic style APIs.
- Make components adapt to Dynamic Type and dark mode by default.
- Show usage examples and previews.

## TASK CRITERIA

### Design Tokens
- Define color, spacing, radius, and typography tokens.
- Source colors from the asset catalog for dark mode.
- Expose tokens via the environment for theming.
- Support multiple brands or themes if needed.

### Component API
- Build components with ViewModifier and custom Style protocols.
- Mirror Apple's pattern (ButtonStyle, LabelStyle) for familiarity.
- Parameterize variants (primary, secondary, destructive).
- Keep call sites concise and declarative.

### Adaptivity
- Scale with Dynamic Type and respect minimum hit targets.
- Adapt to dark mode and high contrast.
- Handle compact versus regular size classes.
- Localize and support right-to-left layouts.

### Composition
- Compose complex components from primitives.
- Avoid leaking internal layout to consumers.
- Provide sensible defaults with override points.
- Document the public API surface.

### Maintainability
- Centralize changes so a token edit propagates everywhere.
- Provide previews for all states and themes.
- Add snapshot or preview coverage.
- Version and document breaking changes.

## ASK THE USER FOR
- Your brand colors, typography, and spacing scale.
- The components you need first (buttons, cards, inputs).
- Whether you need multiple themes or brands.
- Minimum deployment target.

Or press ⌘C to copy

Ready to use?

Copy and paste into your favorite AI tool

Test this prompt live

Try it in our AI Playground with Claude

Open Playground

Explore more Coding prompts

Browse Coding

Command Palette

Search for a command to run...