SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

On this page

StoryRing

A picture in a ring that says whether there is a story to watch.

View code
tsx
<ul>
	{people.map((person) => (
		<li>
			<a href={person.story}>
				<StoryRing seen={person.seen} size={4}>
					<img src={person.avatar} alt="" />
				</StoryRing>
				{person.handle}
			</a>
		</li>
	))}
</ul>

Installation

An ordinary dependency: install it, import the theme once, and import the component where it is used.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
import { StoryRing } from "@sdxc/ui/video";

Renders the ring around its picture, its size set on the element itself so every ring shares one set of rules and the seen state always wins. The unseen ring paints --ui-story-ring, the brand's solid colour unless a page names a gradient; the seen ring paints the quiet border colour.

Props

Read from the component's own types, so every prop, every default and every allowed value is listed.

PropTypeRequiredDescription
childrenRemixNodeYesThe picture inside the ring: an avatar, a drawn cover.
seenbooleanNoWhether every story behind it has been seen, which quiets the ring. Default: false.
sizenumber | stringNoThe ring's outer size in rem, or a CSS length, such as a custom property a page changes with its width. Default: 4.

Also accepts everything in Omit<TagProps<"span">, "children">.

@sdxc/ui

Can’t find it? Contact us