Sinua
Platforms

SwiftUI

The Sinua views for SwiftUI (iOS 15+).

Add the CoreEngine Swift package and import Sinua. Each object has a typed view with its patterns as an enum and its props as parameters. FxView is the generic view underneath it: it takes a pattern name or an FX Spec.

swiftui.swift
import SwiftUI
import Sinua

struct AssistantCard: View {
    let specJSON: String   // an .fxspec.json, e.g. exported from the Studio

    var body: some View {
        VStack(spacing: 24) {
            // Typed: one component per object, parameters as properties.
            SinuaRing(pattern: .completing, progress: 0.65, strokeWidth: 0.12)
                .frame(width: 64, height: 64)

            // A spec file; `state` picks its lifecycle state.
            SinuaOrb(spec: specJSON, state: "listening")
                .frame(width: 160, height: 160)

            // The low-level view takes any pattern or spec.
            SinuaView(pattern: "speaking", theme: .dark)
                .frame(width: 96, height: 96)
        }
    }
}

The view animates with the display, pauses when it disappears or the scene isn't active, follows accessibilityReduceMotion, and drops to 30 fps in Low Power Mode. It draws vectors at display scale, so it's crisp at any size.

The typed components take the same props on iOS, Android and React Native: pattern (or spec), values, style, state, voice, theme, paused, reducedMotion, maxFps, lowPower and an accessibility label. The catalog lists every prop per pattern.