Story Components

Web components for building Instagram Stories with HTML. Drop <insta-*> elements into your page to render pixel-perfect stickers using the same rendering engine as the Storrito editor.

Quick Start

<script src="https://ORG_UUID.storrito.com/js/insta-components.js"></script>

<insta-story>
  <div style="position:absolute;top:0;left:0;width:100%;height:100%;
              background:#1a1a2e"></div>
  <div style="position:absolute;top:0;left:0;width:100%;height:100%;
              box-sizing:border-box;padding:300px 60px;
              display:flex;flex-direction:column;align-items:center;
              justify-content:center;gap:40px">
    <p style="margin:0;font-family:'Instagram Sans Condensed';
              font-size:100px;color:#ffffff;font-weight:bold">Hello!</p>
    <insta-hashtag hashtag="travel"></insta-hashtag>
    <insta-link url="https://example.com" text="Shop Now"></insta-link>
  </div>
</insta-story>

Key Concepts

  • Container: <insta-story> defines a 1080x1920px canvas. All stickers go inside it.
  • Layout: Put every sticker into one flex column and let the browser space them, as in the Quick Start: <div style="position:absolute;top:0;left:0;width:100%;height:100%;box-sizing:border-box;padding:300px 60px;display:flex;flex-direction:column;align-items:center;gap:40px">. Sticker sizes depend on their text, options and design, so hand-picked top values for absolutely positioned stickers overlap easily. Use absolute positioning only for a sticker that has to sit on a specific spot of the background, and leave room for the rendered sizes listed in the Component Reference.
  • Sticker sizes: Pill stickers (hashtag, mention, location, link) are 177px tall and their width follows the text. Polls, questions, quizzes, countdowns and emoji sliders are 690-820px wide and 260-890px tall. The rendered size of every component is listed in the Component Reference.
  • Sticker size size="instagram": Stickers are drawn in Instagram's current sticker design, but by default inside the box listed in the Component Reference, the size of the earlier design, so that existing layouts keep their spacing and look: the new sticker is never wider and never taller than that box and is centred in it (a pill is as tall as before and a little narrower). Add size="instagram" to a sticker (every sticker except <insta-music>) to get the size Instagram gives a new sticker instead, usually smaller. CSS width and transform: scale(...) resize a sticker in both cases: without size freely, with size="instagram" within Instagram's range (see Sticker size limits).
  • Sticker size limits: Like in the Instagram app, a sticker with size="instagram" can only be made as small or as large as Instagram lets you pinch it: <insta-emoji-slider> 157-933px wide, <insta-mention> 6-138px tall, <insta-poll> 158-910px wide, <insta-question> 339-1084px wide, <insta-link> 83-146px tall, <insta-quiz> 158-910px wide, <insta-countdown> 175-1032px wide, <insta-hashtag> 6-138px tall, <insta-location> 6-138px tall (pills by their height, since their width follows the text). A sticker outside its range (CSS width, height or transform: scale(...)) is changed to the limit around the same centre and reported in the warnings of schedule-instagram-story.
  • Spacing: Stickers must not touch or overlap: it looks broken and makes them hard to tap on Instagram. A flex gap of 40px or more keeps them apart. schedule-instagram-story reports overlapping stickers in the warnings of its response and schedules the story anyway.
  • Safe zone: Instagram overlays its own UI on stories (profile bar at the top, reply bar at the bottom). Keep stickers within the safe zone: 250px from the top, 300px from the bottom and 60px from the left and right edges, so a sticker's top edge is at least at top: 250px and its bottom edge at most at 1620px (a pill sticker 177px tall starts at top: 1443px at the latest). The flex column's padding of 300px top and bottom and 60px left and right keeps everything inside it; the top padding is 300px like the bottom, so a column with justify-content:center stays centered. Stickers placed outside this area may be obscured by Instagram's UI.
  • Scaling: Scale the story container with CSS transform: scale(0.25) to fit it into your page. The story always renders at full 1080x1920 resolution.
  • Transforms: Rotate and scale individual stickers via CSS transform. A transform does not change the layout box, so rotated stickers in a flex column keep their gap.
  • Invisible stickers: design="invisible" on <insta-link>, <insta-hashtag>, <insta-mention> and <insta-music> puts a tappable area on the story without a sticker visual, over a button, a name or a hashtag that the background shows itself (an invisible music sticker still plays its song). Its CSS width and height set the area (without them it has the size of the visible sticker); each side is between 120px and 1000px, and an area outside these limits is changed to them around the same centre and reported in the warnings of schedule-instagram-story. An invisible sticker is never rotated: a rotation is replaced by the box it covers, with a warning. design="invisible" on any other sticker is reported as well, that sticker stays visible. On this page a dashed frame shows where the area is; the posted story shows nothing there. Keep it inside the safe zone like any sticker.
  • Music: <insta-music search-term="Beautiful Day U2"> adds Instagram's music sticker (design: simple, album-art, vinyl or invisible). Storrito searches the search term with the Instagram account that posts the story right before the story is rendered and takes the first song Instagram finds, so name the song title and the artist. When Instagram finds nothing, the story is posted without music; a story rendered again later searches again. track-id (Instagram's track id) takes that track among the songs found instead of the first, and start-ms starts its section there instead of at Instagram's suggested start, e.g. <insta-music search-term="Beautiful Day U2" track-id="249810515420048" start-ms="42000">; when the posting account does not find that track, the first song plays from its suggested start. This page and the scheduling request do not know the song yet: the page shows the search term and a gray cover, the previewUrl of status-instagram-story shows the found song. One music sticker per story (only the first <insta-music> is used), an image story with music becomes a 15 second video, and business accounts can only use the royalty-free Meta Sound Collection. An account that Instagram does not offer the music sticker is refused like for every sticker.
  • Sticker box: Give interactive stickers a real rendered box. transform: scale(...), flexbox and explicit width / height are supported, but avoid zero-size boxes. When a sticker has no rendered width or height, Instagram may accept the story while making the native sticker invisible or hard to tap.
  • Text: There is no <insta-text> component, write text as plain HTML elements (<p>, <h1>, <div>, etc.) with CSS styling. In a flex column give them margin:0, the gap provides the spacing. The font Instagram Sans Condensed (regular + bold) is automatically loaded by insta-components.js and is the default Instagram story text font. Other auto-loaded fonts: AvenyT, Roboto (regular + bold), Noto Color Emoji. All Google Fonts from /css/fonts.css are also available. Example: <p style="margin:0;font-family:'Instagram Sans Condensed';font-size:80px;color:#fff;font-weight:bold">Hello!</p>

Composed Examples

Full story compositions showing how to combine multiple stickers.

See Full Examples→

Component Reference

Story Container<insta-story>

The 1080x1920 container for an Instagram story. All sticker elements are placed inside this container. The default background is black (#000). There is no `background` attribute — use a child `<div>` or `<img>` element with absolute positioning to set a custom background color or image (see Quick Start example above).

AttributeTypeDefaultDescription
srcstring—URL to a video file. The video is displayed as the story background and can be toggled play/pause by clicking.

Examples

Custom background
<insta-story></insta-story>
Video background
<insta-story src="https://assets.mixkit.co/videos/1164/1164-1080.mp4"></insta-story>

Hashtag Sticker<insta-hashtag>

Renders an Instagram-style hashtag pill sticker.

Rendered size: 177px tall, the width follows the text: 454px for "#travel". An invisible one has the CSS `width` and `height` you give it, 120-1000px each.

AttributeTypeDefaultDescription
hashtagstring—The hashtag text (without the # symbol).
designenum: default, gray, rainbow, invisible"default"Visual design variant: `default` a white pill, `gray` frosted glass, `rainbow` a rainbow border. `invisible` puts a tappable area without a visual on the story, over something the background shows (see "Invisible stickers" in the Key Concepts).
sizeenum: instagram—Without it the sticker is drawn in Instagram's current design inside the box below, the size of the earlier sticker design: never wider or taller, centred in it. `instagram` gives it the size Instagram gives a new sticker instead, usually smaller.

Examples

Default
<insta-hashtag hashtag="travel"></insta-hashtag>
Frosted glass
<insta-hashtag hashtag="summer" design="gray"></insta-hashtag>
Rainbow
<insta-hashtag hashtag="photography" design="rainbow"></insta-hashtag>
Invisible
<insta-hashtag hashtag="travel" design="invisible"></insta-hashtag>
Instagram size
<insta-hashtag hashtag="travel" size="instagram"></insta-hashtag>

Mention Sticker<insta-mention>

Renders an Instagram-style @mention pill sticker.

Rendered size: 177px tall, the width follows the text: 594px for "@vacations". An invisible one has the CSS `width` and `height` you give it, 120-1000px each.

AttributeTypeDefaultDescription
usernamestring—The Instagram username (without the @ symbol).
designenum: default, gray, rainbow, invisible"default"Visual design variant: `default` a white pill, `gray` frosted glass, `rainbow` a rainbow border. `invisible` puts a tappable area without a visual on the story, over something the background shows (see "Invisible stickers" in the Key Concepts).
sizeenum: instagram—Without it the sticker is drawn in Instagram's current design inside the box below, the size of the earlier sticker design: never wider or taller, centred in it. `instagram` gives it the size Instagram gives a new sticker instead, usually smaller.

Examples

Default
<insta-mention username="vacations"></insta-mention>
Frosted glass
<insta-mention username="johndoe" design="gray"></insta-mention>
Rainbow
<insta-mention username="photographer" design="rainbow"></insta-mention>
Invisible
<insta-mention username="vacations" design="invisible"></insta-mention>

Location Sticker<insta-location>

Renders an Instagram-style location sticker with a pin icon.

Rendered size: 177px tall, the width follows the text: 529px for "Cologne".

AttributeTypeDefaultDescription
locationstring—The location name to display.
location-idstring—Optional Instagram location ID for linking.
designenum: default, gray, rainbow"default"Visual design variant: white (`default`), frosted glass (`gray`) or a rainbow border (`rainbow`), the designs Instagram offers. The former `black` and `orange` are shown as `default`, with a warning.
sizeenum: instagram—Without it the sticker is drawn in Instagram's current design inside the box below, the size of the earlier sticker design: never wider or taller, centred in it. `instagram` gives it the size Instagram gives a new sticker instead, usually smaller.

Examples

Default
<insta-location location="Cologne"></insta-location>
Frosted glass
<insta-location location="Berlin" design="gray"></insta-location>
Rainbow
<insta-location location="Tokyo" design="rainbow"></insta-location>

Link Sticker<insta-link>

Renders an Instagram-style link sticker with a chain icon.

Rendered size: 177px tall, the width follows the text: 605px for "Shop Now". An invisible one has the CSS `width` and `height` you give it, 120-1000px each.

AttributeTypeDefaultDescription
urlstring—The URL the link points to.
textstring"Link"Display text for the link.
designenum: default, gray, black, rainbow, invisible"default"Visual design variant. `invisible` puts a tappable area without a visual on the story, over something the background shows (see "Invisible stickers" in the Key Concepts).
sizeenum: instagram—Without it the sticker is drawn in Instagram's current design inside the box below, the size of the earlier sticker design: never wider or taller, centred in it. `instagram` gives it the size Instagram gives a new sticker instead, usually smaller.

Examples

Default
<insta-link url="https://example.com/shop"></insta-link>
Custom text
<insta-link url="https://example.com" text="Shop Now" design="gray"></insta-link>
Rainbow
<insta-link url="https://example.com" text="Visit Site" design="rainbow"></insta-link>
Invisible
<insta-link url="https://example.com/shop" design="invisible"></insta-link>

Poll Sticker<insta-poll>

Renders an Instagram-style poll card with 2-4 options. With a question the card has a header in the poll color, without one it is only the options.

Rendered size: 768px wide, 566px tall with 2 options, 728px with 3, 890px with 4.

AttributeTypeDefaultDescription
questionstring—The poll question text, optional.
optionsJSON array—JSON array of option strings, e.g. '["Yes", "No"]'. Supports 2-4 options.
colorenum: black, pink, lavender, purple, orange, green, blue"black"Color theme for the poll. Instagram only supports these specific colors: black (#0C1014), pink (#FE0169), lavender (#D402C6), purple (#7536FA), orange (#FF7A00), green (#1DD04F), blue (#0294F6).
sizeenum: instagram—Without it the sticker is drawn in Instagram's current design inside the box below, the size of the earlier sticker design: never wider or taller, centred in it. `instagram` gives it the size Instagram gives a new sticker instead, usually smaller.

Examples

Pink, 2 options
<insta-poll question="Beach or Mountains?" options='["Beach", "Mountains"]' color="pink"></insta-poll>
Purple, 4 options
<insta-poll question="Best language?" options='["JavaScript", "Python", "Clojure", "Rust"]' color="purple"></insta-poll>
Green
<insta-poll question="Do you agree?" options='["Yes", "No"]' color="green"></insta-poll>
Instagram size
<insta-poll question="Do you agree?" options='["Yes", "No"]' size="instagram"></insta-poll>

Question Sticker<insta-question>

Renders an Instagram-style question box where followers can submit responses. Its input field reads "Schreibe etwas ..." when the story is German (`lang="de"` on `<html>`, `<insta-story>` or the sticker), "Type something ..." otherwise.

Rendered size: 771px wide, 454px tall.

AttributeTypeDefaultDescription
questionstring—Optional prompt text displayed as the title of the question box. Without it the box has no title row.
colorenum: white, black, pink, lavender, purple, orange, green, blue"white"Background color theme. Instagram only supports these specific colors: white (#ffffff), black (#262626), pink (#FE0169), lavender (#D402C6), purple (#7536FA), orange (#FF7A00), green (#1DD04F), blue (#0294F6).
sizeenum: instagram—Without it the sticker is drawn in Instagram's current design inside the box below, the size of the earlier sticker design: never wider or taller, centred in it. `instagram` gives it the size Instagram gives a new sticker instead, usually smaller.

Examples

White
<insta-question question="Ask me anything!" color="white"></insta-question>
Pink
<insta-question question="What do you think?" color="pink"></insta-question>
Purple
<insta-question question="What's your favorite food?" color="purple"></insta-question>

Quiz Sticker<insta-quiz>

Renders an Instagram-style quiz card with a dark header and multiple choice options, each with its letter. Instagram only supports the dark color (#262626) for quiz stickers.

Rendered size: 771px wide, 541px tall with 2 options, 709px with 3, 877px with 4.

AttributeTypeDefaultDescription
questionstring—The quiz question text.
optionsJSON array—JSON array of answer strings. Supports 2-4 options.
correct-answernumber0Zero-based index of the correct answer.
sizeenum: instagram—Without it the sticker is drawn in Instagram's current design inside the box below, the size of the earlier sticker design: never wider or taller, centred in it. `instagram` gives it the size Instagram gives a new sticker instead, usually smaller.

Examples

Default
<insta-quiz question="Capital of France?" options='["London", "Paris", "Berlin", "Madrid"]' correct-answer="1"></insta-quiz>
Three options
<insta-quiz question="Legs on a spider?" options='["6", "8", "10"]' correct-answer="1"></insta-quiz>

Countdown Sticker<insta-countdown>

Renders an Instagram-style countdown timer. Instagram only supports these specific solid colors.

Rendered size: 693px wide, 433px tall.

AttributeTypeDefaultDescription
titlestring"COUNTDOWN"Title text displayed above the timer.
end-timestring—ISO 8601 datetime string in UTC for the countdown target. Values with trailing `Z` and values without timezone are accepted, e.g. "2027-12-02T00:00:00Z" or "2027-12-02T00:00:00". It must lie in the future.
colorenum: black, white, purple, red, orange, yellow, green, blue"black"Color theme. Instagram only supports these specific colors: black (#262626), white (#ffffff), purple (#a307ba), red (#ed4956), orange (#fd8d32), yellow (#fdcb5c), green (#70c050), blue (#3897f0).
sizeenum: instagram—Without it the sticker is drawn in Instagram's current design inside the box below, the size of the earlier sticker design: never wider or taller, centred in it. `instagram` gives it the size Instagram gives a new sticker instead, usually smaller.

Examples

Black
<insta-countdown title="NEW YEAR" end-time="2027-03-02T00:00:00"></insta-countdown>
Red
<insta-countdown title="LAUNCH DAY" end-time="2027-06-02T12:00:00" color="red"></insta-countdown>
Blue
<insta-countdown title="SALE ENDS" end-time="2027-09-02T00:00:00" color="blue"></insta-countdown>

Emoji Slider<insta-emoji-slider>

Renders an Instagram-style emoji slider for sentiment reactions.

Rendered size: 818px wide, 262px tall without a question, 467px with one.

AttributeTypeDefaultDescription
questionstring—Optional question text displayed above the slider.
emojistring"😍"The emoji shown on the slider handle.
colorstring"#ffffff"Background color of the slider bar.
text-colorstring"#000000"Color of the question text.
sizeenum: instagram—Without it the sticker is drawn in Instagram's current design inside the box below, the size of the earlier sticker design: never wider or taller, centred in it. `instagram` gives it the size Instagram gives a new sticker instead, usually smaller.

Examples

White bg, pizza
<insta-emoji-slider question="How much do you like pizza?" emoji="🍕" color="#ffffff" text-color="#000000"></insta-emoji-slider>
Dark bg, heart eyes
<insta-emoji-slider question="Rate this sunset" emoji="😍" color="#262626" text-color="#ffffff"></insta-emoji-slider>
No question
<insta-emoji-slider emoji="🔥" color="#FE0169" text-color="#ffffff"></insta-emoji-slider>

Music Sticker<insta-music>

Adds a song from Instagram's music library with Instagram's music sticker. Storrito searches the `search-term` with the Instagram account that posts the story right before the story is rendered and takes the first song Instagram finds; its section plays for the length of the story. The preview shows the search term as the title and a gray cover; the story shows the song's title, artist and cover, and the sticker keeps its centre. When Instagram finds no song for the search term, the story is posted without the music sticker. Instagram shows one music sticker per story: only the first `<insta-music>` is used. Business accounts can only use the royalty-free Meta Sound Collection, so a popular song is often not found for them. An image story with a music sticker becomes a 15 second video. With `track-id` Storrito takes that track among the songs it finds for the search term instead of the first, and with `start-ms` the section starts there instead of at Instagram's suggested start, for a song a person picked with its section. When the track is not among the songs found (the posting account's catalog differs), the first song plays from its suggested start.

Rendered size: Simple: 201px tall, the width follows the search term (643px for "Beautiful Day U2"). Album art: 561x705px. Vinyl: 561x688px. In the story the sticker shows the found song, so its size changes around its centre. An invisible one has the CSS `width` and `height` you give it, 120-1000px each.

AttributeTypeDefaultDescription
search-termstring—What Storrito searches in Instagram's music library, e.g. the song title and the artist.
designenum: simple, album-art, vinyl, invisible"simple"Instagram's music sticker visual: `simple` (white card), `album-art` (large cover), `vinyl` (spinning record). `invisible` plays the song without a visual and puts a tappable area on the story (see "Invisible stickers" in the Key Concepts).
track-idstring—Optional: Instagram's id of the track (digits), as Instagram's music search answers it. Picks that track among the songs found for `search-term`; keep the search term the track's title and artist so that the search finds it.
start-msnumber—Optional: where the section starts, in milliseconds from the song's start. A start that leaves less than the story's length of the song is moved back so the section fits.

Examples

Simple
<insta-music search-term="Beautiful Day U2"></insta-music>
Album art
<insta-music search-term="Beautiful Day U2" design="album-art"></insta-music>
Vinyl
<insta-music search-term="Beautiful Day U2" design="vinyl"></insta-music>
Invisible
<insta-music search-term="Beautiful Day U2" design="invisible"></insta-music>