Skip to main content

Documentation 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.

Advanced UI

PrismUI includes specialized utilities for animation, accessibility auditing, performance optimization, and developer tooling.

Animation

Six animation systems for building fluid, physical interactions:
ComponentDescription
PrismSpringConfigPre-tuned spring configurations (bouncy, snappy, smooth)
PrismKeyframeBuilderKeyframe-based animation sequences
PrismPhysicsAnimationGravity, friction, and collision-based animations
PrismSharedTransitionHero/shared element transitions between views
PrismStaggeredAnimationCascading animations for list items
PrismGestureAnimationGesture-driven interactive animations
Staggered List Animation
ForEach(Array(items.enumerated()), id: \.element.id) { index, item in
    ItemRow(item: item)
        .prismStaggered(index: index, total: items.count)
}
Spring Configurations
withAnimation(PrismSpringConfig.bouncy.animation) {
    isExpanded.toggle()
}

Accessibility

Built-in tools for auditing and ensuring accessibility compliance:
Accessibility Audit
PrismAccessibilityAudit {
    YourContentView()
}
// Reports: contrast issues, missing labels, touch target sizes, focus order problems
ComponentDescription
PrismAccessibilityAuditScans a view hierarchy for a11y violations
PrismContrastCheckerVerifies WCAG AA/AAA contrast ratios between color pairs
PrismColorBlindnessSimulatorRenders views through color blindness filters (protanopia, deuteranopia, tritanopia)
PrismDynamicTypePreviewPreviews views at all Dynamic Type sizes
PrismFocusOrderDefines explicit keyboard/VoiceOver focus traversal order
PrismReduceMotionProvides reduced-motion alternatives for animations
PrismVoiceControlLabelAdds voice control labels for hands-free navigation
PrismAccessibilityAnnouncementPosts VoiceOver announcements programmatically
Contrast Check
let passes = PrismContrastChecker.meetsAA(
    foreground: theme.color(.onBackground),
    background: theme.color(.background)
)

Performance

Utilities for optimizing rendering and memory in large UIs:
ComponentDescription
PrismLazyViewDefers view creation until it appears on screen
PrismImageDownsamplerDownsizes images to display size before rendering
PrismMemoryTrackerMonitors memory usage and warns on thresholds
PrismPrefetchCoordinatorPre-loads data for upcoming scroll positions
PrismRenderProfilerMeasures view body evaluation and render time
Image Downsampling
PrismImageDownsampler(
    url: highResURL,
    targetSize: CGSize(width: 200, height: 200)
)

View Modifiers

25+ view modifiers for common UI patterns:
ModifierDescription
.prismAnimation()Apply token-based animation timing
.prismScroll()Themed scroll indicators and bounce
.prismHover()Hover state effects (macOS, iPadOS)
.prismGlass()Frosted glass material background
.prismResponsive()Adapt layout based on size class
.prismTypography()Apply typography token
.prismSkeleton()Show skeleton placeholder when loading
.prismTransition()Token-based view transitions
.prismContentTransition()Animated content changes
.prismSwipeActions()Swipeable row actions
.prismContextMenu()Themed context menu
.prismToolbar()Toolbar configuration
.prismRefreshable()Pull-to-refresh
.prismFocus()Focus state management
.prismKeyboardShortcut()Keyboard shortcut binding
.prismSpacing()Token-based padding/margin
.prismShape()Clip to themed shapes
.prismOrnament()visionOS ornament placement
.prismMotion()Motion-sensor reactive effects
.prismRedacted()Redacted/placeholder content
.prismLabelStyle()Custom label styling
.prismSensoryFeedback()Haptic/audio feedback
.prismSharing()Share sheet integration
.prismUndo()Undo/redo gesture support
.prismAnalytics()Track view impressions
.prismPerformance()Render performance monitoring

Rich Text

ComponentDescription
PrismMarkdownViewRenders Markdown with themed styling
PrismRichTextEditorWYSIWYG rich text editor
PrismSyntaxHighlighterCode syntax highlighting for 20+ languages
PrismAttributedStringBuilderFluent API for building AttributedString
Markdown
PrismMarkdownView("""
# Hello World
This is **bold** and this is `code`.
""")

SwiftData Integration

Components that bridge SwiftData models with PrismUI:
ComponentDescription
PrismModelViewDetail view auto-generated from a SwiftData model
PrismModelListList view with search, sort, and pagination for a model
PrismModelFormBuilderAuto-generated edit form from model properties
PrismPredicateBuilderVisual predicate/filter builder UI
PrismMigrationHelperMigration status and progress view
PrismCloudSyncStatusiCloud sync status indicator
Auto-Generated Model List
PrismModelList(
    modelType: Task.self,
    sortBy: \.createdAt,
    searchKeyPath: \.title
) { task in
    TaskRow(task: task)
}

Widgets & Live Activities

ComponentDescription
PrismWidgetViewBase widget view with theme and token support
PrismLiveActivityLive Activity builder with themed content
PrismComplicationwatchOS complication templates

Internationalization

ComponentDescription
PrismStringCatalogType-safe string catalog access
PrismPluralizationPluralization rules for multiple locales
PrismLayoutDirectionRTL/LTR layout adaptation
PrismLocaleFormattersLocale-aware number, date, and currency formatters
PrismLocalePreviewHelperPreview views in multiple locales side by side

Drag & Drop

Drag and Drop
PrismDragDrop(items: $tasks) { task in
    TaskRow(task: task)
} onReorder: { from, to in
    tasks.move(fromOffsets: from, toOffset: to)
}

Developer Tools

Tools for building, inspecting, and testing your design system:
Storybook
PrismStorybook {
    PrismStorybook.Section("Buttons") {
        PrismButton("Filled", variant: .filled) {}
        PrismButton("Outlined", variant: .outlined) {}
        PrismButton("Ghost", variant: .ghost) {}
    }
    PrismStorybook.Section("Cards") {
        PrismCard { Text("Default") }
    }
}
ToolDescription
PrismStorybookInteractive component catalog
PrismComponentBrowserBrowsable component gallery with search
PrismTokenInspectorVisual inspector for all design tokens
PrismPrototyperRapid prototyping canvas
PrismLiveReloadHot-reload preview updates
PrismComponentDebuggerView hierarchy and state debugger
PrismEnvironmentDebuggerEnvironment values inspector
PrismComponentGeneratorCode-gen scaffolding for new components

Testing

ToolDescription
PrismPreviewCatalogAll components in a single preview
PrismSnapshotTestPixel-perfect snapshot testing
PrismAccessibilityTestAutomated a11y test assertions
PrismPerformanceBenchmarkRender performance benchmarking
PrismThemeTestVerify theme token coverage
PrismDevicePreviewPreview on multiple device sizes
PrismPreviewProvidersReusable preview data providers
PrismPreviewBlocksComposable preview building blocks
PrismThemeEditorLive theme editing in previews

Export & Plugin

ToolDescription
PrismFigmaSyncSync tokens with Figma variables
PrismTokenExportExport tokens to JSON/CSS/Tailwind formats
PrismPluginPlugin protocol for extending PrismUI with custom components