Turn a detected UI screenshot into an animated .riv
riv_ui_prototypeTurn detected UI elements into a working Rive prototype: assign each a role to generate entrances, hover, and press states as a .riv file.
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 the same imagePath (or svgPath), minArea and maxElements you gave riv_ui_detect, or the ids will not line up. 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.
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 (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) | |
| interactions | No | Add hover and press states where the role has them (default true) |