PRACTICAL RIVE INTEGRATION
How to embed a Rive animation on a website
Use a SideQuest web component, an iframe, or the Rive runtime to put an interactive animation on a website.
Choose the integration that fits your page
The web component is the quickest route when your page needs to read and update values. Use an iframe for an isolated visual demo. Use the Rive runtime directly when your application already has its own canvas, accessibility layer, and lifecycle management.
Load the module once
Put the module script on the page once, then add as many component instances as the layout needs. Keep enough room for the effects: controls use a 560 × 280 artboard; text and titles use 960 × 540. Responsive width preserves the artboard ratio.
Connect behavior to your application
A button’s animation does not perform a purchase, save a record, or prove success. Listen for sq-action to start your application’s action, then call done() after that action succeeds. Read change events for the control’s value. Keep the authoritative state in your app.
Serve the files over HTTP
JavaScript modules and WebAssembly need a web server. Opening a downloaded kit with file:// will not behave like a hosted page. For a local check, run python3 -m http.server 8000 in the kit folder and open localhost:8000. When self-hosting, retain the asset and vendor directories. Test the result on the page where people will use it.
<script type="module" src="https://thesidequest.studio/elements/elements.js"></script>
<sq-element type="toggle" name="notifications" label="Notifications"></sq-element>