Skip to content
Hazine

Rotating Noun Hero

Pro

Hero whose heading ends in a fixed-size slot that cycles through a list of audiences, with pause and step controls and an index of every audience below. Use it when one product serves several kinds of team.

How it differs. One slot in a start-aligned heading rotates through nouns under a pause and step control, and a hairline index of every noun below marks the one on show. Static full list under reduced motion.

Install

pnpm dlx shadcn@latest add @hazine/hero-rotating-noun

Adds 1 file, 1 shadcn primitive (button), 2 Hazine items (@hazine/heading, @hazine/use-controllable-state), and 1 package (lucide-react).

First time? Add the registry to components.json
{
  "registries": {
    "@hazine": {
      "url": "https://api.hazine.dev/r/{name}.json",
      "headers": { "Authorization": "Bearer ${HAZINE_TOKEN}" }
    }
  }
}

Set HAZINE_TOKEN in your environment. The token comes with a Pro licence.

Props15

title
string = "Shift planning for"
The fixed part of the heading. The rotating noun follows it on its own line.
nouns
HeroNoun[] = DEFAULT_NOUNS
unit
HeroUnit = DEFAULT_UNIT
description
string = "Rotaline builds each rota from availability, contracts and skills, then offers open shifts to your own bank staff before an agency sees them."
primaryAction
HeroAction = DEFAULT_PRIMARY_ACTION
secondaryAction
HeroAction | null = DEFAULT_SECONDARY_ACTION
Pass null to render a single action.
interval
number = 3000
Milliseconds each noun stays in the slot.
index
number
Position of the noun in the slot.
defaultIndex
number = 0
onIndexChange
(index: number) => void
paused
boolean
Rotation stopped by the pause control. Hovering the heading and keyboard focus stop it without changing this.
defaultPaused
boolean = false
onPausedChange
(paused: boolean) => void
headingLevel
1 | 2 | 3 = 1
locale
string = "en-US"

Also accepts every prop of Omit<React.ComponentProps<"section">, "title">.

Accessibility

Pattern
Landmarks and headings, Button (APG, opens in a new tab)
Keyboard
Keyboard support for Rotating Noun Hero
KeyEffect
TabMoves through pause, previous, next and the two action links. Rotation stops while keyboard focus is inside the section, and while the pointer is over the heading or its controls
Enter or Space on PauseStops the rotation until it is pressed again, and the button is renamed to resume
Enter or Space on Previous or NextShows the neighbouring word, wrapping at either end, and announces it with its position
Screen reader

A section labelled by its heading. The rotating word is hidden from assistive tech, which reads the heading once with every noun in a visually hidden list. The pause control comes before the moving text, and manual steps are announced in a status region.

  • Announces: {noun}, {position} of {count}.
Reduced motion
Nothing rotates and the controls are removed. The heading shows every noun as one static list, and the index marks none of them.
Checked
Not checked yet. Automated results appear here once CI has run.

Dependencies4

  • button
  • @hazine/heading
  • @hazine/use-controllable-state
  • lucide-react

Filled chips are registry items the CLI adds for you. Outlined chips are npm packages.

Tokens shipped0

None. The item is styled by the tokens your theme already has.

Other takes on this1

The same question answered with a different structure.

  • headline led

    Baseline centred stack: badge, heading, paragraph and two actions in one column, with no media and nothing else above the fold.

    shadcn add @hazine/hero-section

    Depends on badge, button, @hazine/heading, lucide-react

More in Heroes