PrismUI treats accessibility as a first-class requirement, not an afterthought. Every built-in component ships with accessibility labels, respects Dynamic Type, and checksDocumentation 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.
accessibilityReduceMotion before running any animation. Beyond the components themselves, PrismUI provides a set of utilities that let you audit, test, and validate accessibility in your own code.
VoiceOver support
Every PrismUI component sets appropriate accessibility labels, values, hints, and traits without any configuration on your part. Here are a few examples of what happens automatically:PrismButtoninherits its label from the button title and announces loading state changes.PrismAvatarcollapses its sub-views into a single element with a label that combines initials and status (for example, “JD, online”).PrismRatingannounces the current value as a fraction: “3 out of 5 stars”.PrismPinFieldannounces entry progress: “2 of 6 entered”.PrismProgressBarannounces the percentage for determinate progress and “In progress” for indeterminate.
prismAccessibility() modifier to set label, hint, value, and traits in one call:
Dynamic Type
All typography in PrismUI usesTypographyToken, which maps to Font.TextStyle values. SwiftUI scales these automatically with the user’s preferred text size — from .xSmall through .accessibility5 — without any extra configuration.
Use PrismDynamicTypePreview in your SwiftUI Previews to verify that your components look correct across the full Dynamic Type range before you ship:
.xSmall, .medium, .large, .xxxLarge, and .accessibility3, stacked vertically in a scroll view.
Never use fixed
CGFloat font sizes in components that will render user content. Always use TypographyToken or a Font.TextStyle so Dynamic Type works correctly.Reduce Motion
PrismUI reads@Environment(\.accessibilityReduceMotion) in every component that animates. When the user enables Reduce Motion in system settings, all animations are disabled automatically throughout the component library.
MotionToken.instant vs MotionToken.expressive
MotionToken.instant uses a 0.10 s linear curve — appropriate for state changes that should feel immediate and non-distracting. MotionToken.expressive uses a 0.50 s spring with a 0.2 bounce — appropriate for delight-driven transitions like expanding cards or onboarding sequences.
When Reduce Motion is on, both tokens produce no animation. When it is off, instant provides a barely perceptible transition while expressive delivers a visible spring effect:
Conditional motion in custom views
Use.prismMotionSafe() to apply a transform only when Reduce Motion is disabled:
PrismReduceMotion when you need to show different views entirely for reduced and full motion:
WCAG contrast validation
PrismContrastChecker calculates WCAG 2.x relative luminance and contrast ratios. Use it to verify that any foreground/background combination in your app meets a target compliance level.
Compliance levels
| Level | Use case | Minimum ratio |
|---|---|---|
.aa | Normal text (body, labels) | 4.5:1 |
.aaa | Enhanced normal text | 7.0:1 |
.aaLargeText | Large text (18 pt+, or 14 pt bold+) | 3.0:1 |
.aaaLargeText | Enhanced large text | 4.5:1 |
Checking a color pair
Suggesting an accessible alternative
If a color pair fails a target level,suggestAccessibleColor adjusts the foreground’s lightness until the ratio is met:
HighContrastTheme
HighContrastTheme maximizes contrast ratios beyond WCAG AAA. It uses pure platform foreground and background colors for text and surfaces, bolder border opacities, and saturated feedback colors:
PrismThemeStore includes HighContrastTheme registered as "highContrast" by default, so no extra registration is needed.
Color blindness simulation
PrismColorBlindnessSimulator applies a 3×3 color-transformation matrix to simulate how a color appears under different vision deficiencies. Use it in development to verify that color is never the only way you convey meaning.
Available types
| Type | Description |
|---|---|
.protanopia | Red-blind — no red cone function |
.deuteranopia | Green-blind — no green cone function |
.tritanopia | Blue-blind — no blue cone function |
.achromatopsia | Total color blindness — monochromatic |
.protanomaly | Red-weak — reduced red cone sensitivity |
.deuteranomaly | Green-weak — reduced green cone sensitivity |
.tritanomaly | Blue-weak — reduced blue cone sensitivity |
Focus order
VoiceOver reads views in the order they appear in the view hierarchy. When your layout uses overlapping views, z-stacks, or custom drawing, the traversal order may not match the logical reading order. UseprismFocusOrder() to set explicit sort priorities.
Higher priority numbers are read first:
Accessibility announcements
UsePrismAccessibilityAnnouncer to post screen-reader announcements programmatically — for example, when an async operation completes:
.prismAnnounce():
.polite to wait for current speech to finish, and .assertive to interrupt immediately for time-sensitive information.
Accessibility audit and testing
Runtime audit
.prismAccessibilityAudit() logs warnings for views missing accessibility labels during DEBUG builds. It has no effect in release builds.
♿ to identify unlabeled elements.
Unit test assertions
PrismAccessibilityTest provides two static helpers you can call directly in XCTestCase:
PrismContrastChecker, so your unit tests and runtime checks stay consistent.