Seregon/StratoSDK

StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.

Rust/27.3 KB/No license
docs/swiftui_parity.md
StratoSDK / docs / swiftui_parity.md
1# SwiftUI Parity Tracker for StratoSDK
2 
3This document inventories StratoSDK widgets against their closest SwiftUI counterparts and highlights gaps to help us prioritize API parity.
4 
5## Current Coverage
6 
7| SwiftUI component | StratoSDK equivalent | Notes on parity |
8| --- | --- | --- |
9| `Text` | `Text` | Size/color APIs already mirror SwiftUI's basic modifiers. |
10| `Image` | `Image` | Supports fit/format options; add rendering modes to match `resizable()` / `aspectRatio()`. |
11| `Button` | `Button` | Now exposes hover/press/focus/disabled visuals and accessibility labels. |
12| `Slider` | `Slider` | Dragging, hover/press states, semantics for value exposure. |
13| `ProgressView` | `ProgressBar` | Determinate progress matches `ProgressView(value:)`; indeterminate animation still basic. |
14| `Toggle` | `Checkbox` | Provides boolean selection; radio buttons cover grouped selection similar to `Picker` with `segmented`. |
15| `TextField` | `TextInput` | Basic text entry available; needs parity for secure entry and prompt styles. |
16| `ScrollView` | `ScrollView` | Vertical/horizontal scrolling already supported. |
17| `HStack` / `VStack` | `Row` / `Column` | Flex-based layout covers SwiftUI stacks. |
18| `ZStack` | `Stack` | Overlapping layout via `Stack` matches SwiftUI. |
19| `List` | `ScrollView` + `Column` | No dedicated list yet; composition required. |
20 
21## Missing or Partial Components
22 
23| SwiftUI component | Status in StratoSDK | Proposed parity direction |
24| --- | --- | --- |
25| `Toggle` (switch style) | Missing dedicated switch UI | Introduce `Switch` widget with `on_change`, `is_on`, and `.tint(Color)` akin to SwiftUI. |
26| `Stepper` | Not available | Add `Stepper` with `value`/`in`/`step` bindings; reuse slider semantics for accessibility. |
27| `Picker` (menus/wheels) | Only dropdown covered | Extend `Dropdown` into a general `Picker` supporting wheel style for desktop/mobile parity. |
28| `DatePicker` / `ColorPicker` | Missing | Provide specialized pickers with localized formatting and signal outputs. |
29| `NavigationStack` / `TabView` | Not present | Plan container widgets for navigation stacks and tab bars to mirror SwiftUI routing. |
30| `Alert` / `Sheet` | Absent | Modal primitives with async confirmation callbacks should mirror SwiftUI's `.alert` and `.sheet` modifiers. |
31| `ToggleStyle` / `ButtonStyle` protocols | Style structs only | Introduce trait-based styling hooks so widgets accept custom style conformances similarly to SwiftUI. |
32| `GeometryReader` | Partial via layout engine | Expose explicit `GeometryReader`-like widget to pass layout info into children. |
33 
34## Parity Guidelines
35 
361. **Naming alignment**: Prefer SwiftUI naming when semantics match (e.g., `Stepper`, `Toggle`, `NavigationStack`).
372. **Modifier parity**: Map common modifiers (`.disabled`, `.focused`, `.animation`, `.tint`) to builder methods on widgets.
383. **Accessibility**: Every interactive control should expose role, label, hint, and value/toggled state just like SwiftUI's accessibility modifiers.
394. **Stateful visuals**: Hover/press/focus/disabled should be animated by default to reduce custom boilerplate and mirror SwiftUI's built-in behaviors.
405. **Composable fallbacks**: When a dedicated widget is missing, document the composition path (e.g., `ScrollView` + `Column` as a `List` stand-in) until a native widget ships.
41