Use this file to discover all available pages before exploring further.
Design tokens are the single source of truth for every visual decision in PrismUI. Instead of scattering raw values like Color(.systemBlue) or padding(16) throughout your codebase, you reference named tokens that resolve to concrete values through the active theme. This means swapping an entire visual identity requires changing one line, and every component in your app updates automatically.PrismUI ships with six token types. Each one is a Swift enum, so the compiler catches typos, Xcode auto-completes every case, and refactoring is safe across your entire project.
ColorToken defines 28 semantic color roles organized into six groups. The active theme resolves each role to a concrete Color — the same token maps to different hues in DefaultTheme, DarkTheme, or your own BrandTheme.
Use semantic tokens, not specific hues. Write .brand instead of .blue so your UI adapts automatically when the theme changes.
Token
Group
Purpose
brand
Brand
Primary brand color
brandVariant
Brand
Secondary brand tint (80% opacity of brand)
background
Backgrounds
Primary screen background
backgroundSecondary
Backgrounds
Grouped or secondary background
backgroundTertiary
Backgrounds
Tertiary or inset background
surface
Surfaces
Card and container background
surfaceSecondary
Surfaces
Secondary card background
surfaceElevated
Surfaces
Elevated surface (modals, popovers)
onBackground
Content
Primary text on backgrounds
onBackgroundSecondary
Content
Secondary text on backgrounds
onBackgroundTertiary
Content
Tertiary / placeholder text
onSurface
Content
Primary text on surfaces
onSurfaceSecondary
Content
Secondary text on surfaces
onBrand
Content
Text and icons placed on brand color
border
Borders
Standard border
borderSubtle
Borders
Subtle / lighter border
separator
Borders
List and section separators
interactive
Interactive
Default interactive element color
interactiveHover
Interactive
Hover state (90% interactive)
interactivePressed
Interactive
Press state (70% interactive)
interactiveDisabled
Interactive
Disabled state
success
Feedback
Positive / confirmation
warning
Feedback
Caution
error
Feedback
Destructive / failure
info
Feedback
Informational
shadow
Utility
Shadow tint
overlay
Utility
Modal backdrop
Apply a semantic color to any view with the .prismColor() modifier:
TypographyToken maps to Apple’s Dynamic Type system. Every case corresponds to a Font.TextStyle and carries a default Font.Weight, so text scales correctly with the user’s preferred text size without any extra work on your part.
SpacingToken is a 4-point grid system. Every spacing value is a multiple of 4pt, which keeps layouts consistent and makes spacing decisions deterministic.
RadiusToken controls corner rounding using Apple’s continuous (squircle) style — the same curve used throughout iOS and macOS. Every token exposes a ready-to-use RoundedRectangle shape via .shape and an UnevenRoundedRectangle via .clipShape.
Token
Value
none
0 pt
xs
4 pt
sm
8 pt
md
12 pt
lg
16 pt
xl
24 pt
full
9999 pt (capsule)
Apply a background with a radius using .prismSurface():
ElevationToken controls shadow depth through a five-level hierarchy. Higher levels signal more visual prominence — use them for modals and overlays, not for ordinary cards.
MotionToken defines animation durations and curves. Every animation in PrismUI uses these tokens — and the .prismAnimation() modifier automatically disables animations when the user has enabled Reduce Motion in system accessibility settings.
Token
Duration
Curve
instant
0.10 s
.linear
fast
0.15 s
.easeOut
normal
0.25 s
.easeInOut
slow
0.35 s
.easeInOut
expressive
0.50 s
.spring(bounce: 0.2)
snappy
0.25 s
.snappy
bouncy
0.35 s
.bouncy
smooth
0.30 s
.smooth
Apply a motion-safe animation with .prismAnimation():
Always use .prismAnimation() or check @Environment(\.accessibilityReduceMotion) before running animations. PrismUI components do this internally, but custom animations in your own views need the same treatment.
This applies the title text style, the onBackground semantic color, 16 pt padding, and a surfaceSecondary background with a 16 pt continuous corner radius — all resolved through the active theme at runtime.