# Cinema hero

> A video-first hero: a film-leader countdown cuts to your film playing with subtitles, the screen lights the room, and a 35mm chapter strip scrubs and jumps through it.

Video sales pages usually drop a YouTube embed under a headline, and nobody presses play. Cinema hero puts your film on a screen in a dark room and starts it for them. A 3·2·1 film leader runs on load, then the film plays muted with its subtitles burned in, so it reads without sound. The screen is the room’s only light: its colour, sampled from the playing frame, washes the wall behind it. Under the screen a 35mm strip runs edge to edge, one frame per chapter, with the chapter number, timecode and title printed in the film margin. The strip pulls down a frame each time the film crosses a chapter; visitors drag it to scrub and click a frame to jump. "Watch with sound" plays the real film from the top, in place.

## Install

```bash
npx shadcn@latest add @hairline/cinema-hero
```

Needs React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.

- npm: `lucide-react`
- Hairline UI components it needs (the CLI installs them too): none
- Docs and live preview: https://hairlineui.com/blocks/cinema-hero
- Registry item (source): https://hairlineui.com/r/cinema-hero.json

## Usage

```tsx
import { CinemaHero } from "@/components/cinema-hero";

<CinemaHero
  brand="Hankly"
  headline={["Free components", "that look expensive"]}
  highlight="look expensive"
  subheadline="Watch the build, then install any of them with one command."
  primaryAction={{ label: "Browse the components", href: "/ui" }}
  video={{ src: "/film.mp4", poster: "/film-poster.webp", start: 3.2 }}
  chapters={[
    { title: "Sign in", time: 29.2, still: "/ch-1.webp" },
    { title: "Just talk", time: 36, still: "/ch-2.webp" },
  ]}
  captions={[{ start: 3.3, end: 4.8, text: "That's one line of React." }]}
/>
```

## Chapters and subtitles from your own film

Encode the film as H.264 (960×540 is plenty), export one still per chapter at 16:9, and turn your subtitle file into caption lines. The colours are --ch-* variables and the type is --ch-display and --ch-sans.

```tsx
import { Barlow, Barlow_Condensed } from "next/font/google";
import { CinemaHero } from "@/components/cinema-hero";
import { captions } from "./film-captions"; // [{ start, end, text }] from your .srt

const display = Barlow_Condensed({ subsets: ["latin"], weight: ["600"] });
const sans = Barlow({ subsets: ["latin"], weight: ["400", "500"] });

export default function Page() {
  return (
    <CinemaHero
      tone="dark"
      style={{
        "--ch-display": display.style.fontFamily,
        "--ch-sans": sans.style.fontFamily,
        "--ch-signal": "#7de2d1",
      } as React.CSSProperties}
      brand="Northdesk"
      eyebrow="A four-minute walkthrough"
      headline={["Close the books", "before lunch"]}
      highlight="before lunch"
      subheadline="Watch a controller run month-end in four minutes, then try it on your own ledger."
      primaryAction={{ label: "Start a trial", href: "/signup" }}
      video={{ src: "/films/month-end.mp4", poster: "/films/month-end.webp", start: 2 }}
      chapters={[
        { title: "Import the bank feed", time: 12, still: "/films/ch1.webp" },
        { title: "Match in bulk", time: 58, still: "/films/ch2.webp" },
        { title: "Lock the period", time: 171, still: "/films/ch3.webp" },
      ]}
      captions={captions}
    />
  );
}
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `brand` | `string` | – | Name in the nav. |
| `logo` | `ReactNode` | – | Replaces the default reel mark. |
| `navLinks` | `{ label: string; href: string }[]` | – | Links in the bar; they fold into a menu under 900px. |
| `navSecondaryAction / navPrimaryAction` | `{ label: string; href?: string; onClick?: () => void }` | – | A quiet link and the signal button at the right of the bar. |
| `eyebrow` | `string` | – | One plain line above the headline. |
| `headline` | `string[]` | – | One or two lines, set in the display face, uppercase. |
| `highlight` | `string` | – | A phrase inside the headline painted in --ch-signal. |
| `subheadline` | `string` | – | The sentence under the headline. |
| `primaryAction` | `{ label: string; href?: string; onClick?: () => void }` | – | The signal button beside "Watch with sound". |
| `watchLabel` | `string` | `"Watch with sound"` | Label of the button that plays the film from the top with audio; the film’s length shows beside it. |
| `video` | `{ src: string; poster?: string; start?: number; duration?: number }` | – | The film. `start` is where the muted preview begins; `duration` shows before the metadata loads. |
| `chapters` | `{ title: string; time: number; still: string }[]` | – | One frame of the strip per chapter, in order. |
| `captions` | `{ start: number; end: number; text: string }[]` | – | Subtitle lines burned into the screen. |
| `countdown` | `boolean` | `true` | Run the 3·2·1 leader before the film. |
| `tone` | `"dark" \| "light"` | `"dark"` | The room’s tone; the film strip stays dark in both. |

## States

- **leader**: On load a grey film leader counts 3·2·1 with a sweeping hand, in CSS, then cuts to the film.
- **preview**: The film plays muted with burned-in subtitles; the strip pulls down a frame at each chapter and the wall takes the frame’s colour.
- **scrub**: Dragging the strip shows the still under the gate on the screen; letting go jumps to that chapter.
- **sound**: "Watch with sound" plays the film from the top with audio; a click on the screen pauses it.
- **phone**: The headline and actions stack, the screen runs full width and the strip swipes sideways; the nav folds into a menu that pushes the page down.
- **reduced motion**: No leader and no autoplay: the poster shows with a play mark and the strip stays still until a visitor presses play.

## What it handles

A video hero usually means a third-party embed with its own branding, a poster nobody clicks, and no way to see what’s in the film.

- **Starts itself, reads on mute**: After the leader the film plays muted from `video.start` with your captions burned in, and pauses when it scrolls off screen.
- **Chapters on a film strip**: One frame per chapter with its number, timecode and title in the margin. The strip follows the film, drags to scrub and clicks to jump.
- **Light from the film**: The playing frame is sampled a few times a second and its colour washes the wall. A cross-origin film without CORS still plays; the light just stays neutral.
- **Sound in place**: "Watch with sound", a click on the screen or the sound key plays the real film with audio, without a modal.
- **Your own film**: Pass an mp4, a poster, chapters with stills and caption lines. No player library and no embed.
- **Dark and light**: Tone "dark" or "light", with every colour as an --ch-* variable; the film strip stays film-dark in both.

## Replaces

YouTube or Vimeo embed, custom video player chrome, chapter list, subtitle overlay

## Where it fits

- **Video sales letters and course launches**: The film plays muted with subtitles on arrival, and the chapters show what’s inside before anyone presses play.
- **Product launch films**: A two-minute walkthrough split into chapters that people can jump between.
- **Agencies and studios**: A showreel or case-study film with the work itself lighting the page.
- **Coaches and creators**: A talking-head pitch that reads on mute and books the call underneath.

## Notes

- Colours: --ch-room, --ch-wall, --ch-ink, --ch-ink-2, --ch-ink-3, --ch-rule, --ch-hover, --ch-signal, --ch-on-signal, --ch-film, --ch-film-edge, --ch-mask, --ch-spill-amount. They never inherit your shadcn theme.
- The film loads with preload="metadata" and plays muted and inline, which every current browser allows; if autoplay is refused, the poster shows with a play mark.
- The room’s light reads a 32×18 copy of the frame, which needs the film on your origin or served with CORS. Without it, everything else works.
- Chapters are buttons with their title and time as labels, and the arrow keys move between them. The subtitles are real text.
- Under prefers-reduced-motion there is no leader and no autoplay.

License: MIT (https://hairlineui.com/license#components)
