Hero: theme cycle
Hero whose accent word wears your primary color.
Preview
The whole hero re-colors through a set of themes. It stops on hover, on focus and with the visible pause button. With reduced motion turned on, it renders the plain layout.
Your theme, not ours
The accent word, badge and buttons follow --primary. Sample copy.
Your theme, not ours
The accent word, badge and buttons follow --primary. Sample copy.
Installation
Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.
Usage
import { HeroThemeCycle } from "@/components/custom/hero-theme-cycle";
<HeroThemeCycle
title="Your theme, not ours"
accentWord="theme"
primaryAction={{ label: "Get started", href: "/signup" }}
/>import { HeroThemeCycleMotion } from "@/components/custom/hero-theme-cycle/hero-theme-cycle-motion";
<HeroThemeCycleMotion title="Your theme, not ours" accentWord="theme" interval={3000} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | The headline, rendered as the page's h1. |
| eyebrow | string | – | Small badge above the title. |
| description | string | – | Supporting line under the title. |
| primaryAction | { label: string; href: string } | – | Filled button. |
| secondaryAction | { label: string; href: string } | – | Outline button. |
| accentWord* (required) | string | – | Word in the title to color; ignored if the title doesn't contain it. |
| themes | { name; primary; primaryForeground }[] | 5 shadcn colors | Themes the motion version cycles through. |
| interval | number | 2500 | Milliseconds between themes (motion version). |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | The headline, rendered as the page's h1. |
| eyebrow | string | – | Small badge above the title. |
| description | string | – | Supporting line under the title. |
| primaryAction | { label: string; href: string } | – | Filled button. |
| secondaryAction | { label: string; href: string } | – | Outline button. |
| accentWord* (required) | string | – | Word in the title to color; ignored if the title doesn't contain it. |
| themes | { name; primary; primaryForeground }[] | 5 shadcn colors | Themes the motion version cycles through. |
| interval | number | 2500 | Milliseconds between themes (motion version). |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
Accessibility
- The accent is color plus position, never color alone: the word is still part of the heading text.
- The motion version follows the visitor's reduced-motion setting and never hides content before it animates.