204 Pro components and page blocks

Get Pro

Updated

Story Ring

New

Preview

Customize

Size64px
Color
Load time900ms

Installation

npx shadcn@latest add https://uibrik.com/r/story-ring.json
Adds the files to components/uibrik/story-ring and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/story-ring.

Usage

import { StoryRing } from "@/components/uibrik/story-ring/story-ring";​<StoryRing  name="…"  size={64}  color="#e1306c"  loadTime={900}  showName  count={3}  onOpen={(index) => {}}  // src="…"  // seen={0}  // onSeenChange={(seen) => {}}/>

Where to use Story Ring

  • Stories and status rows

    One arc per story shows how many are left, and seen arcs drain to grey, so the row tells people where they left off.

    Pairs with Avatar Stack

  • Unread updates on people

    A coloured ring marks someone with something new without adding a badge or a count to the avatar.

    Pairs with Presence Dot

  • Loading media from a profile

    The ring itself becomes the spinner while the story fetches, so no separate loader covers the face.

    Pairs with Social Avatar

Props

StoryRing
size
Type number
64
Avatar diameter.
color
Type string
"#e1306c"
Ring colour, drawn as a gradient of its own shades.
colors
Type string[]
["#feda75","#fa7e1e","#d62976","#962fbf","#4f5bd5"]
Two or more colours for the ring's gradient.
loadTime
Type number
900
How long the ring spins when onOpen returns no promise.
showName
Type boolean
true
Show the name under the avatar.
namerequired
Type string
–
Name under the avatar, and the initials when there's no photo.
src
Type string
–
Avatar image.
count
Type number
3
Stories in the ring, one arc each.
seen / onSeenChange
Type number / (seen) => void
–
Controlled number of stories seen. defaultSeen for uncontrolled.
onOpen
Type (index) => void | Promise
–
Called on press with the story to open. The ring spins until the promise settles.
className
Type string
–
Classes for the wrapper.