# Story Ring

> An avatar in a segmented story ring that spins into dashes while a story loads, then drains the arc you opened to grey.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Components › Avatars & Badges |
| Live preview | https://uibrik.com/components/story-ring |
| Writes | 1 file into `components/uibrik/story-ring/` |
| Packages | `motion` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 24, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/story-ring.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/story-ring`.

Can't run commands? https://uibrik.com/components/story-ring/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
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) => {}}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/story-ring.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `size` | `number` | `64` | Avatar diameter. |
| `color` | `string` | `"#e1306c"` | Ring colour, drawn as a gradient of its own shades. |
| `colors` | `string[]` | `["#feda75","#fa7e1e","#d62976","#962fbf","#4f5bd5"]` | Two or more colours for the ring's gradient. |
| `loadTime` | `number` | `900` | How long the ring spins when onOpen returns no promise. |
| `showName` | `boolean` | `true` | Show the name under the avatar. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `name` (required) | `string` |  | Name under the avatar, and the initials when there's no photo. |
| `src` | `string` |  | Avatar image. |
| `count` | `number` | `3` | Stories in the ring, one arc each. |
| `seen / onSeenChange` | `number / (seen) => void` |  | Controlled number of stories seen. defaultSeen for uncontrolled. |
| `onOpen` | `(index) => void \| Promise` |  | Called on press with the story to open. The ring spins until the promise settles. |
| `className` | `string` |  | Classes for the wrapper. |

## Where it fits

- **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](https://uibrik.com/components/avatar-stack.md).
- **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](https://uibrik.com/components/presence-dot.md) (Pro).
- **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](https://uibrik.com/components/social-avatar.md).

## Same shelf: Avatars & Badges

- [Tech Stack](https://uibrik.com/components/tech-stack.md): A row of real brand logos for the tools behind a product that open into tinted pills naming each one as neighbours slide aside.
- [Verified Badge](https://uibrik.com/components/verified-badge.md): A scalloped verified seal in blue, gold or grey that stamps in with a turn, draws its check and catches one pass of light.
- [Account Switcher](https://uibrik.com/components/account-switcher.md) (Pro): An account switcher whose trigger is a stack of faces: picking an account deals its face to the front while the name rolls over and a check lands.
- [Avatar Stack](https://uibrik.com/components/avatar-stack.md): Overlapping avatars that fan on hover and spring apart into a named list on a card growing out of the row.
- [Contribution Avatar](https://uibrik.com/components/contribution-avatar.md) (Pro): An avatar wrapped in its own contribution graph: rings of days and spokes of weeks that light up in a sweep. Hover a day for its count and week, tap to pin it, and pick out a shade or the streak from the key.
- [Light Badge](https://uibrik.com/components/light-badge.md): A badge lit from below by a rotating gradient stroke and soft rays.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/story-ring/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
