# Mist hero

> A calm deep-green hero: a field of fine dots with mist rolling in from below and turning to cream. Steam lifts out of it on load, the pointer parts it, and a tap releases a puff.

Calm consumer brands usually get a soft gradient or a product photo on beige. Mist hero builds a quiet green morning in WebGL2: a field of fine dots, a few catching the light, and mist rolling in from below that turns to cream at the bottom edge, so the next section can simply be cream. On load the mist rises and three plumes of steam lift out of it. The pointer parts the mist and lights the dots near it; a click or tap releases a puff of steam that rises and thins out. Quick links, a headline and two actions sit on the left; a label for this month’s product sits in the cream.

## Install

```bash
npx shadcn@latest add @hairline-pro/mist-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/mist-hero
- Premium block, included with All-Access (https://hairlineui.com/buy/all-access?from=blocks). Installs only with an All-Access token through the @hairline-pro registry: https://hairlineui.com/ui/installation#premium. Its source isn't public.

## Usage

```tsx
import { MistHero } from "@/components/mist-hero";

<MistHero
  brand="Greenmoor"
  navLinks={[{ label: "Teas", href: "/teas", active: true }, { label: "Brewing", href: "/brewing" }]}
  navAction={{ label: "Get a tin", href: "/start" }}
  quickLinks={[{ label: "This month's tin", href: "/this-month" }]}
  headline={["The kettle's on.", "The rest can wait."]}
  subheadline="Small-batch loose leaf from six upland farms, on your doorstep every month."
  primaryAction={{ label: "Start my tin", href: "/start" }}
  secondaryAction={{ label: "How it works", href: "/how" }}
  label={{ title: "No. 14 · Kirishima sencha", facts: ["Picked 2 May", "Steep 70°C for 90 s"] }}
/>
```

## Your colours and face

MistHero reads type from --mh-display and --mh-sans and every colour from --mh-* variables, the mist included. mistLine sets how high the mist rises.

```tsx
import { Hanken_Grotesk } from "next/font/google";
import { MistHero } from "@/components/mist-hero";

const face = Hanken_Grotesk({ subsets: ["latin"], weight: ["400", "500", "600"] });

<MistHero
  mistLine={0.36}
  style={{
    "--mh-display": face.style.fontFamily,
    "--mh-sans": face.style.fontFamily,
    "--mh-green": "#2a3140",
    "--mh-deep": "#161b25",
    "--mh-cream": "#e4e7ec",
  } as React.CSSProperties}
  brand="Stillwater"
  headline={["Sleep starts", "an hour earlier."]}
  subheadline="Wind-down sounds that fade with you."
  primaryAction={{ label: "Try a night free", href: "/start" }}
/>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `brand / logo` | `string / ReactNode` | – | Wordmark and mark; the default mark is a steaming cup. |
| `navLinks` | `{ label; href; active? }[]` | – | Links in the pill; the active one is a lighter pill. |
| `navAction` | `{ label; href?; onClick? }` | – | The cream button at the end of the pill. |
| `quickLinks` | `{ label; href }[]` | – | Small arrow links above the headline. |
| `headline` | `string[]` | – | Two or three lines; each rises out of its slot. |
| `subheadline` | `string` | – | One sentence. |
| `primaryAction / secondaryAction` | `{ label; href?; onClick? }` | – | Cream pill and a glass pill. |
| `label` | `{ title; facts: string[] }` | – | This month’s product, set in the cream at the bottom. |
| `mistLine` | `number` | `0.42` | How high the mist rises, as a share of the height. |

## States

- **arrival**: The mist rises from the bottom edge and three plumes of steam lift out of it while the headline lines rise.
- **pointer**: The mist thins around the pointer and the dots near it brighten.
- **steam**: A click or tap off the controls releases a puff that rises and thins out.
- **phone**: Under 820px the links fold into a menu sheet; the label sits under the copy in the cream.
- **reduced motion**: One still frame with the mist in place; no steam.

## What it handles

A calm hero usually means a blurred gradient that never changes, or a video of fog that ignores the visitor.

- **Mist in two passes**: The mist is drawn soft at a third of the resolution, then laid over a crisp dot field at full resolution.
- **Steam you make**: A click or tap anywhere off the controls releases a puff that rises, widens and thins out over a few seconds.
- **Parts for the pointer**: The mist thins around the pointer and the dots near it brighten, like a torch in the morning.
- **Fades into your page**: The bottom edge turns to cream (--mh-cream), so a cream section can follow without a seam.
- **A bar in one pill**: Links and the main action share one pill; on phones a menu opens a sheet.
- **Quiet when idle**: Half frame rate while nothing moves; stops off screen and in hidden tabs.

## Replaces

background video, gradient blob, particles library

## Where it fits

- **Tea, coffee and food subscriptions**: Steam from the cup is the idea; the label names this month’s box.
- **Plants, gardens and outdoors**: Morning mist over a dark field, with the season’s drop on the label.
- **Sleep, wellness and meditation apps**: A calm first screen people stay on, with something to touch.
- **Skincare and slow living brands**: Swap the green for your own and keep the cream fade into the page.

## Notes

- Colours: --mh-green, --mh-deep, --mh-cream, --mh-dot (the field and the mist), --mh-ink, --mh-ink-2, --mh-ink-3, --mh-glass, --mh-edge, --mh-on-cream, --mh-label-ink. They never inherit your shadcn theme.
- Put a section in --mh-cream right after it and the mist runs straight into it.
- The canvas is capped at about 2.4 million pixels and the mist is drawn at a third of that; it runs at half the frame rate when nothing moves and stops off screen.
- Needs WebGL2; without it the hero is plain green and everything else works.

License: Hairline UI commercial license, not MIT (https://hairlineui.com/license#blocks)
