ReelFeed
A full-height vertical feed of short videos, one per screen, the way a reels or shorts tab reads.
mara.quint
Throwing the two halves of a moon jar.
teo.lind
Ninety minutes of harbour fog in twenty seconds.
ines.bakes
Scoring, one cut each, no second chances.
ola.surfs
Seven degrees and you chose this.
View code
<ReelFeed label="Reels" followAddress prefetchTarget="main">
{reels.map((reel, index) => (
<ReelFeed.Item
href={`/reels/${reel.id}`}
label={`Reel by ${reel.author}`}
offset={index - current}
loopAt={reel.seconds}
sources={[{ src: reel.webm, type: "video/webm" }]}
labels={{ pause: "Pause" }}
>
<p>{reel.caption}</p>
</ReelFeed.Item>
))}
</ReelFeed>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { ReelFeed } from "@sdxc/ui/video";Renders the feed: a labelled feed scroller that snaps one reel per screen, and the island
that runs it. It keeps scrolling and snapping without script; the reel at offset 0 is
where the scroller starts and the one that autoplays.
Composition
The parts the component publishes, each a static property of the host.
ReelFeedReelFeed.ItemOne reel: a screen-high snap point holding a stage as tall as the feed and at most 9:16 wide, with the backdrop, the video, a full-stage play button and the overlay over it, and a progress line along its foot.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Required | Description |
|---|---|---|---|
label | string | Yes | The feed's accessible name, such as "Reels". |
followAddress | boolean | No | Puts each reel's href in the address bar as it comes on screen, in place, so the address always shares the reel being watched. |
autoAdvance | boolean | No | Moves on to the next reel when the one on screen reaches its end, the way a reels tab plays through; the last reel loops. Without it every reel loops until the visitor swipes. |
loop | boolean | No | Runs on from the last reel to the first, by swipe, key, wheel, step control or autoAdvance, so the feed never ends; the island adds a copy of the first reel to do it. |
prefetchTarget | string | No | The frame the next reel's page is prefetched into, such as main, so moving to it with a link renders without waiting; the document hint is prefetched either way. |
children | RemixNode | Yes | ReelFeed.Item elements in feed order. |
controls | RemixNode | No | Controls beside the scroller, such as up and down arrows: an element marked data-reel-step="1" or "-1" steps the feed, so a link to the next reel moves it in place; the island keeps its link on the neighbouring reel and marks it aria-disabled at an end. |
Also accepts everything in TagProps<"section">.
ReelFeed.Item
| Prop | Type | Required | Description |
|---|---|---|---|
href | string | Yes | The reel's own address, which the feed follows and prefetches. |
label | string | Yes | The reel's accessible name, such as "Reel by Mara Quint". |
offset | number | Yes | The reel's index minus the index of the reel the page opens on: 0 marks that reel, which the scroller starts at and which autoplays, and the distance sets its preload. |
sources | Source[] | Yes | |
loopAt | number | No | Plays the video only this many seconds before looping, for a clip longer than the reel. |
backdrop | RemixNode | No | Drawn behind the video, for a transparent clip or while it loads. |
labels | { pause: string } | Yes | The stage's play button names: it reads pause while playing, pressed once paused. |
children | RemixNode | No | What sits over the video: the author, the caption, the action column. |
Also accepts everything in Omit<TagProps<"article">, "children">.