Turn a detected UI screenshot into an animated .riv
riv_ui_prototypeTurns elements detected from a screenshot, SVG, or Figma frame into a working .riv: assigns each a role, then adds role-based entrance animations and hover/press states to buttons and cards.
Instructions
Take the elements from riv_ui_detect, assign each one a role, and get back a working .riv: every element becomes a shape or an image asset, each gets an entrance appropriate to its role, and buttons and cards get hover and press states. Roles: background, nav, header, card, panel, button, fab, text, icon, image, chart, list-item, badge, divider, avatar, input. Elements you leave unassigned animate as a generic panel. Pass exactly one of imagePath, svgPath or figmaUrl, the same one you gave riv_ui_detect. If you changed minArea or maxElements there, pass the same values here so the ids match. With svgPath no screenshot is embedded, every element stays editable, and the file reproduces the SVG; its becomes real Rive text you can re-type at runtime, and its embedded data becomes an image asset. figmaUrl fetches the same thing straight from Figma, and needs FIGMA_TOKEN.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"outPath": "<outPath>",
"roles": "<roles>"
},
"name": "riv_ui_prototype"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fonts | No | Fonts for the SVG's <text>. svgPath only. Without a match the bundled Inter is used and a warning says so; a run whose glyphs the font lacks (CJK, say) is baked as a picture rather than embedded as tofu | |
| roles | Yes | Role for each element. Ids you omit fall back to a generic panel. | |
| ambient | No | Give roles with an idle motion a looping ambient animation (default true) | |
| minArea | No | Must match the riv_ui_detect call. imagePath only (default 576) | |
| outPath | Yes | Where to write the .riv | |
| stagger | No | Delay between elements entering, in milliseconds | |
| svgPath | No | The same SVG you passed to riv_ui_detect (instead of imagePath) | |
| figmaUrl | No | The same Figma link you passed to riv_ui_detect. Off unless FIGMA_TOKEN is set in the server's environment. The frame is fetched again, so a design that changed in between can move the ids | |
| imagePath | No | The same screenshot you passed to riv_ui_detect | |
| entranceMs | No | How long the whole entrance takes, in milliseconds | |
| maxElements | No | Must match the riv_ui_detect call (default 120, or 300 for svgPath) | |
| interactions | No | Add hover and press states where the role has them (default true) |