Calm motion: animations on this site only fade, with no movement
Stories
Rings of people with new stories, and a viewer with a timer for each story
Shows short posts that people share for a day, at the top of a social app. A story is one picture with a caption.
Basic
peopleis a list of people. Each person has anid, aname, an optionalavatarandseen, and a list ofstories. Each story has anid, animage, analttext, and an optionalcaptionandtime.- A person with new stories has a solid ring in the accent color. A person whose stories are seen has a thin dashed ring. Screen readers hear "new" for new stories.
- A ring opens the viewer in a modal. Each story shows for
durationseconds (default 5), with a bar for each story on top. Then the next story shows, and after the last story of a person, the stories of the next person. - The Pause button stops the timer, so a reader can take the time they need. The ‹ and › buttons and the arrow keys move between the stories.
- Each story that shows emits
seenwith the id of the person and the story. Use it to setseenon the person. - Change the words with
labelsor a label pack:title,new,previous,next,pause,play, and the functionsopenandprogress.
Usage
ts
import { BlessStories } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
people* | BlessStoryPerson[] | — | |
duration | number | 5 | seconds for each story |
labels | Partial<{ title: string; open: (name: string) => string; new: string; previous: string; next: string; pause: string; play: string; progress: (n: number, total: number) => string; }> | — |
Events
| Name | Payload | Description |
|---|---|---|
seen | [personId: string, storyId: string] |