SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

RotatingText

A word in a headline that cycles through alternatives.

Status pages for startups, agencies, platform teams

View code
tsx
<h2 mix={[displayHeading(2)]}>
	Status pages for{" "}
	<RotatingText words={["startups", "agencies", "platform teams"]} />
</h2>

Demo landings

Whole pages built only from @sdxc/ui, each for an invented product with its own palette and type. They open in a new tab.

Every demo, landings and docs sites alike, is listed in the demo gallery.

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 { RotatingText } from "@sdxc/ui/landing";

Stacks every word in one grid cell and runs one shared keyframe set on each, offset by its position, so exactly one word shows at a time. The animated words are hidden from assistive technology, which reads label instead.

Props

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

PropTypeRequiredDescription
wordsRemixNode[]YesThe alternatives, first one first; two to six read well.
intervalnumberNoSeconds each word holds. Defaults to DEFAULT_INTERVAL.
iterationsnumber | "infinite"NoPasses before settling on the first word, or "infinite"; wrap an endless one in a MotionLoop so it can be paused. Defaults to DEFAULT_ITERATIONS.
labelstringNoWhat assistive technology reads in the word's place. Defaults to the words joined with commas, so a listener hears every alternative.

Also accepts everything in TagProps<"span">.

@sdxc/ui

Can’t find it? Contact us