This guide takes you from zero to a running Prism screen. You’ll add the package, inject a theme into your app’s root view, render aDocumentation Index
Fetch the complete documentation index at: https://docs.prism.byescaleira.com/llms.txt
Use this file to discover all available pages before exploring further.
PrismButton with an async action, and validate a PrismTextField — all using the design token modifiers that keep your UI consistent across every Apple platform.
Add Prism to Package.swift
Open your If you’re working in an Xcode project instead, go to File → Add Package Dependencies, paste the URL above, and add the
Package.swift and add Prism to your dependencies array, then declare it as a dependency of your target.Prism product to your app target.Apply a theme to your root view
Prism’s design system activates when you inject a theme into the SwiftUI environment. Call
.prismTheme(_:) on your app’s root view — every component nested inside will automatically read colors, typography, and spacing from the active theme.DefaultTheme uses Apple HIG system colors and adapts automatically to light and dark mode. To match your brand, substitute BrandTheme:Add a PrismButton with an async action
PrismButton wraps an async closure and automatically shows a loading indicator while the action runs. Pass a variant to control the visual style..filled, .tinted, .bordered, .plain, .glass, and .glassProminent. The button disables itself while the action is in flight — no additional state management required.Add a PrismTextField with validation
PrismTextField accepts a Validation rule that runs when the field loses focus. The error message appears automatically below the field using the theme’s error color..required(_:), .minLength(_:_:), .maxLength(_:_:), and .custom(_:) for arbitrary logic.Style views with semantic modifiers
Rather than hardcoding colors and sizes, use Prism’s semantic modifier API. Each modifier reads from the active theme, so your views adapt automatically when the theme changes.
Combine these modifiers to build cards, labels, and containers that stay visually consistent without any magic numbers.
| Modifier | What it does |
|---|---|
.prismFont(_:) | Applies a TypographyToken — maps to Apple’s Dynamic Type styles |
.prismColor(_:) | Sets foregroundStyle using a ColorToken resolved by the active theme |
.prismPadding(_:) | Applies uniform padding using a SpacingToken from the 4pt grid |
.prismSurface(_:radius:) | Applies a themed background color with a continuous corner radius |
Prism requires Swift 6.3, Xcode 16.4 or later, and a minimum deployment target of iOS 26, macOS 26, tvOS 26, watchOS 26, or visionOS 26. These targets are set deliberately high so that
PrismUI can use the latest SwiftUI APIs without availability guards.