stitch_to_native
Convert a Stitch screen's HTML and Tailwind into SwiftUI, Jetpack Compose, or standalone HTML with matching theme files, so you can move designs into native app code.
Instructions
Convert one Stitch screen to the project's targets in one call (swiftui, compose, html; default = the config's targets, else swiftui + compose), plus the theme file of each. In state mode html is skipped with a warning.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "stitch_to_native"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | HTTPS download URL of the screen HTML (a public https URL; Stitch downloadUrls need OAuth, so pass that HTML via html instead). | |
| html | No | Stitch screen HTML (the export, including the tailwind-config script). | |
| mode | No | state: stateless screen with a State struct + sample, Identifiable rows, a tab Picker, localized keys and callbacks (no ViewModel). | layout |
| name | No | Generated view/composable name. | StitchScreen |
| path | No | Path to a Stitch HTML file. Used when html is not given. | |
| config | No | stitch-native.json contents: {"targets": ["swiftui","compose","html"], "colors": {token|#hex: expr}, "colorsHtml": {token|#hex: cssValue}, "fonts": {token: expr}, "icons": {material: sfSymbol}, "iconsCompose": {material: "Icons.X.Y"}, "iconsHtml": {material: text or inline svg}, "preview": {"colorScheme": "dark|light"}}. Alias: map. Without config, config_path or map, the server looks for stitch-native.json next to `path` and in its parent directories (first one found). | |
| targets | No | Ecosystems to emit, out of swiftui, compose, html. Overrides the config's `targets`; without either: swiftui + compose. A comma-separated string is also accepted. | |
| config_path | No | Path to a stitch-native.json. Used when config is not given. |