# Veil hero

> A waitlist hero with your product under a silk cover. Visitors drag the cloth to peek, its screen glows through the silk, and joining the list whisks the cover off.

Waitlist pages usually hide the product behind a blurred screenshot or a countdown, so there is nothing to look at and no reason to sign up today. Veil hero stands your product on a studio display under a real cloth: a WebGL2 simulation of 2,320 points that drapes, folds and casts shadows from one key light. The screen is on underneath, and its light comes through the silk in your product’s own colours. Visitors drag the cloth to lift it and look (or tap it on a phone), and it falls back when they let go. When someone joins, the cover is whisked off and the display stands bare: the people on the list see it first. Give it one 16:10 screenshot and the date you open.

## Install

```bash
npx shadcn@latest add @hairline-pro/veil-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/veil-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 { VeilHero } from "@/components/veil-hero";

<VeilHero
  brand="Halden"
  opensAt="2027-03-14"
  headline={["A calendar that", "plans your week."]}
  subheadline="Halden moves meetings around your focus time without asking anyone to reschedule."
  screen="/halden-week.png"
  screenAlt="Halden's week view with six meetings moved."
  waitlistCount={2340}
  onJoin={async (email) => {
    await fetch("/api/waitlist", { method: "POST", body: JSON.stringify({ email }) });
  }}
/>
```

## A dark room, your own face and colour

VeilHero reads its type from --vh-display and --vh-sans and every colour from --vh-* variables, the cloth and the room included. tone sets the room and fabric the cloth.

```tsx
import { Funnel_Display, Funnel_Sans } from "next/font/google";
import { VeilHero } from "@/components/veil-hero";

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

export default function Page() {
  return (
    <VeilHero
      tone="noir"
      fabric="velvet"
      style={{
        "--vh-display": display.style.fontFamily,
        "--vh-sans": sans.style.fontFamily,
        "--vh-silk": "#2c4a3e",
        "--vh-lining": "#1b2f27",
        "--vh-on-silk": "#ffffff",
      } as React.CSSProperties}
      brand="Fathom"
      opensAt="2027-02-02"
      headline={["Debug production", "like it's local."]}
      subheadline="Fathom pauses on the line that crashed and shows every value it held."
      screen="/fathom-crash.png"
      screenAlt="Fathom showing a TypeError with the values at the crash."
      joinLabel="Get early access"
      joinedMessage="You're number {position}. Invites go out in February."
      waitlistCount={1182}
    />
  );
}
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `brand` | `string` | – | Wordmark in the bar. |
| `logo` | `ReactNode` | – | Replaces the default draped mark. |
| `navLinks` | `{ label: string; href: string }[]` | – | Quiet links in the bar, hidden under 640px. The bar always ends with a link to the email field. |
| `opensAt` | `string \| Date` | – | The day it opens, shown as the date and the days left. |
| `eyebrow` | `string` | – | Replaces the date line. |
| `headline` | `string[]` | – | Two or three lines; each rises out of its slot on load. |
| `subheadline` | `string` | – | One sentence under the headline. |
| `screen` | `string` | – | A 16:10 picture of your product (1600 × 1000 is plenty). Another origin needs CORS. |
| `screenAlt` | `string` | – | What the screen shows, read out once the cover is off. |
| `waitlistCount` | `number` | – | People already on the list, shown under the field and counted up when someone joins. |
| `onJoin` | `(email: string) => void \| Promise<void>` | – | Save the email. Throw an Error and its message is shown under the field. |
| `placeholder / joinLabel` | `string` | `"you@company.com" / "Join the list"` | The field’s placeholder and the button. |
| `joinedMessage` | `string` | `"You're number {position}. We'll write the day it opens."` | {position} becomes their number on the list. |
| `revealOnJoin` | `boolean` | `true` | Whisk the cover off when someone joins. |
| `launched` | `boolean` | `false` | Take the cover off on load. |
| `tone` | `"studio" \| "noir"` | `"studio"` | A light paper sweep, or a dark room lit by a top light and the screen. |
| `fabric` | `"silk" \| "satin" \| "velvet"` | `silk (studio), satin (noir)` | How the cloth catches light and how much of the screen comes through it. |

## States

- **arrival**: The cover drops onto the display and settles; the screen wakes underneath and its light comes through the silk; a breeze lifts one corner for a moment.
- **peek**: Dragging the cloth lifts it where it was grabbed and shows the screen beneath; letting go drops it back over the display.
- **hover**: The cloth stirs a little where the pointer brushes past it.
- **joining**: The button shows a spinner while onJoin runs; a bad email shakes the field and says why.
- **joined**: The cover is pulled off the top edge and out of the room, the screen lights the floor, and the field becomes the visitor’s place on the list.
- **launched**: With launched set, the cover comes off on load.
- **phone**: Under 900px the headline sits above the display and the form below it; a tap on the cloth flicks it up.
- **reduced motion**: The cover is drawn already resting with the screen on; joining takes it off at once.

## What it handles

A teaser usually means a blurred screenshot, a countdown and an email field that promise nothing. Building a real reveal means a cloth simulation, shadows and a 3D library, and most of them run forever.

- **Real cloth, no library**: Verlet points with stretch, shear and bend constraints, draped over the display and its stand. It sleeps once it stops moving, so a settled page costs nothing.
- **Light that comes through**: Your screenshot is the screen. Where the silk lies on it, its colours glow through the cloth, and once the cover is off its light falls on the floor.
- **Peek without signing up**: Drag the cloth anywhere to lift it, or tap it on a phone. A label on the floor does the same for keyboards and screen readers.
- **Joining is the reveal**: onJoin takes the email. When it resolves, the cover is pulled off the top edge and flies out of the room, and the visitor sees their place on the list.
- **A studio, lit once**: One key light with a soft shadow map, a contact shadow on the paper sweep, a softbox in the glass and a satin or velvet sheen, all in one WebGL2 canvas.
- **Studio or noir**: A light paper sweep or a dark room lit by the screen. Silk, satin or velvet. Every colour is a --vh-* variable.

## Replaces

three.js and a cloth physics library, blurred screenshot teaser, countdown widget, waitlist form states

## Where it fits

- **Pre-launch waitlists**: The cover makes the sign-up the reveal: the people who join see the product first.
- **Private betas and invite lists**: Visitors can lift a corner and see that something real is under there before they leave an email.
- **Launch day**: Set launched and the cover comes off on load, so the same hero carries the page from waitlist to release.
- **Hardware with a screen**: Any product shown as a 16:10 picture: a dashboard, an app, a device UI, a game.

## Notes

- Colours: --vh-ground (the paper), --vh-silk and --vh-lining (the cloth), --vh-metal (the display), --vh-ink, --vh-ink-2, --vh-ink-3, --vh-rule, --vh-field, --vh-field-hover, --vh-on-silk. They never inherit your shadcn theme.
- The loop runs only while something moves, the hero is on screen and the tab is visible. A resting cover draws nothing; the canvas is capped at about 1.7 million pixels.
- Needs WebGL2 (every current browser). Without it the copy and the form still work and the stage stays plain.
- The canvas is aria-hidden. The visual is described for screen readers, and the label on the floor is a button that lifts the cover, so keyboards can peek too.
- On phones the cloth takes taps, not drags, so the page still scrolls over it.
- Under prefers-reduced-motion the cover is drawn resting with the screen on, and joining takes it off without the throw.

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