Embedding Demos
Embed interactive Stepshots demos in your website, docs, or app using React, JS snippets, web components, or iframes.
Overview
Once you've published a demo, you can embed it anywhere. Stepshots supports four embedding methods — pick the one that fits your stack.
Embedding Options
React Component
First-class React integration with typed props.
JS Snippet
Drop a script tag and a data attribute. Works anywhere.
Web Component
Native custom element. No framework needed.
iframe
Zero dependencies. Works in any HTML page.
Configuration Options
All embedding methods support the same core options:
| Option | Type | Default | Description |
|---|---|---|---|
demoId |
string | required | The unique demo identifier |
autoplay |
boolean | false |
Auto-play on load |
theme |
"light" | "dark" |
— | Visual theme |
start |
number | — | Step number to start from (1-indexed) |
hideControls |
boolean | false |
Hide playback controls |
React Component
Install the package:
Basic usage:
function App() {
return <StepshotsDemo demoId="your-demo-id" />;
}With options:
<StepshotsDemo
demoId="your-demo-id"
autoplay
theme="dark"
start={2}
hideControls={false}
width="800px"
aspectRatio="16/9"
/>React Props
| Prop | Type | Default | Description |
|---|---|---|---|
demoId |
string |
required | Demo identifier |
baseUrl |
string |
"https://app.stepshots.com" |
Server URL |
autoplay |
boolean |
— | Auto-play the demo |
theme |
"light" | "dark" |
— | Visual theme |
start |
number |
— | Starting step (1-indexed) |
hideControls |
boolean |
— | Hide playback controls |
width |
string | number |
"100%" |
Container width |
aspectRatio |
string |
"16/9" |
Container aspect ratio |
style |
CSSProperties |
— | Custom inline styles |
className |
string |
— | CSS class name |
JS Snippet
Add the script tag to your page and mark containers with a data-stepshots-demo attribute:
<!-- Basic -->
<!-- With options -->
The script auto-discovers all data-stepshots-demo elements on the page and renders the player in each one.
The JS snippet is ideal for marketing pages, blogs, and documentation sites where you want a quick drop-in embed.
Web Component
Load the web component script and use the <stepshots-demo> custom element:
<!-- Basic -->
<!-- With options -->
You can style the element like any HTML element:
iframe
No scripts required — construct the URL manually:
Add query parameters for options:
Query Parameters
| Parameter | Example |
|---|---|
autoplay |
?autoplay=true |
theme |
?theme=light |
start |
?start=3 |
hide_controls |
?hide_controls=true |
Which Method Should I Use?
| Scenario | Recommended |
|---|---|
| React / Next.js app | React component |
| Static marketing site | JS snippet |
| Any HTML page, no framework | Web component or iframe |
| CMS or restricted HTML (e.g., email) | iframe |
| Documentation site (Docusaurus, Mintlify, etc.) | JS snippet or React component |