Keyboard support, labels and visible focus throughout
Light and dark themes from your design tokens
Brand name, contact details and links set from environment variables
Make it yours without opening the code
The business name, contact details and links are read from environment variables. Add them to .env.local, restart the dev server, and every mention on the page updates. Anything you leave out keeps its sample value.
Variable
Sets
NEXT_PUBLIC_BRAND_NAME
Business name in the header, footer and copy
NEXT_PUBLIC_BRAND_LEGAL_NAME
Registered name in the copyright line
NEXT_PUBLIC_BRAND_TAGLINE
Short line beside the name
NEXT_PUBLIC_BRAND_PHONE
Phone number and its tap-to-call link
NEXT_PUBLIC_BRAND_EMAIL
Contact email and its mail link
NEXT_PUBLIC_BRAND_ADDRESS
Street address
NEXT_PUBLIC_BRAND_ACTION_URL
Destination of the main call to action
Source
Show 2 filesHide code
app/waitlist/page.tsx
"use client";import { useState } from "react";import { Check } from "lucide-react";import { AvatarStack } from "@/components/viewport/avatar-stack";import { DotField } from "@/components/viewport/dot-field";import { FloatingInput } from "@/components/viewport/floating-input";import { RotatingWords } from "@/components/viewport/rotating-words";import { ShimmerButton } from "@/components/viewport/shimmer-button";import { defineBrand } from "@/lib/brand";// Sample details. Each one can be replaced from the environment: see brand.ts.const BRAND = defineBrand({ name: "Quire", tagline: "One workspace for your roadmap, docs and releases.", phone: "(415) 555-0100", email: "hello@quire.example", address: "San Francisco, CA", actionUrl: "#" });const people = ["Ines Moreau", "Theo Park", "Amara Okafor", "Jonas Weber", "Priya Raman", "Lucas Almeida", "Mei Tanaka"].map((name) => ({ name }));/** A one-screen waitlist page with an interactive dot field and an email capture form. */export default function WaitlistTemplate() { const [joined, setJoined] = useState(false); return ( <main className="relative flex min-h-dvh w-full items-center justify-center overflow-hidden px-6 py-16"> <DotField className="absolute inset-0 text-foreground/25 [mask-image:radial-gradient(ellipse_at_center,black_30%,transparent_75%)]" /> <div className="relative mx-auto w-full max-w-md text-center"> <p className="text-sm font-medium text-muted-foreground"><span className="text-foreground">{BRAND.name}</span> · Coming this spring</p> <h1 className="mt-4 text-4xl font-semibold tracking-tight sm:text-5xl"> A calmer way to <RotatingWords words={["plan", "write", "ship", "review"]} /> </h1> <p className="mt-4 text-pretty text-muted-foreground">{BRAND.tagline} Join the waitlist for early access.</p> {joined ? ( <p role="status" className="mt-8 flex items-center justify-center gap-2 rounded-2xl border border-border bg-card px-4 py-4 text-sm font-medium"> <Check className="size-4" aria-hidden /> You're on the list. We'll be in touch. </p> ) : ( <form className="mt-8 flex flex-col gap-3 text-left sm:flex-row sm:items-start" onSubmit={(e) => { e.preventDefault(); setJoined(true); }} > <FloatingInput label="Work email" type="email" name="email" required autoComplete="email" className="flex-1" /> <ShimmerButton type="submit" className="h-12 shrink-0">Join waitlist</ShimmerButton> </form> )} <div className="mt-8 flex items-center justify-center gap-3 text-sm text-muted-foreground"> <AvatarStack people={people} max={4} size={32} /> <span>2,400 people ahead of you</span> </div> </div> </main> );}
lib/brand.ts
/** * Everything a template says about the business, in one place. * * Each template declares sample values with `defineBrand`. Any of them can be * replaced from the environment, so a site can be rebranded without editing * the page. Variables are public (they end up in the browser bundle), so keep * secrets out of them. */export type Brand = { /** The name shown in the header, footer and page copy. */ name: string; /** The registered name used in the copyright line. Falls back to `name`. */ legalName: string; /** One short line under or beside the name. */ tagline: string; /** A phone number as people read it, for example "(415) 555-0142". */ phone: string; email: string; /** Street address on one line. */ address: string; /** Where the main call to action goes: a booking page, a signup form, a checkout. */ actionUrl: string;};// Next.js only inlines environment variables that are written out in full, so they are listed one by one.const fromEnvironment: Partial<Brand> = { name: process.env.NEXT_PUBLIC_BRAND_NAME, legalName: process.env.NEXT_PUBLIC_BRAND_LEGAL_NAME, tagline: process.env.NEXT_PUBLIC_BRAND_TAGLINE, phone: process.env.NEXT_PUBLIC_BRAND_PHONE, email: process.env.NEXT_PUBLIC_BRAND_EMAIL, address: process.env.NEXT_PUBLIC_BRAND_ADDRESS, actionUrl: process.env.NEXT_PUBLIC_BRAND_ACTION_URL,};export const brandVariables: { name: string; key: keyof Brand; sets: string }[] = [ { name: "NEXT_PUBLIC_BRAND_NAME", key: "name", sets: "Business name in the header, footer and copy" }, { name: "NEXT_PUBLIC_BRAND_LEGAL_NAME", key: "legalName", sets: "Registered name in the copyright line" }, { name: "NEXT_PUBLIC_BRAND_TAGLINE", key: "tagline", sets: "Short line beside the name" }, { name: "NEXT_PUBLIC_BRAND_PHONE", key: "phone", sets: "Phone number and its tap-to-call link" }, { name: "NEXT_PUBLIC_BRAND_EMAIL", key: "email", sets: "Contact email and its mail link" }, { name: "NEXT_PUBLIC_BRAND_ADDRESS", key: "address", sets: "Street address" }, { name: "NEXT_PUBLIC_BRAND_ACTION_URL", key: "actionUrl", sets: "Destination of the main call to action" },];/** Sample values for a template, with anything set in the environment taking their place. */export function defineBrand(sample: Omit<Brand, "legalName"> & { legalName?: string }): Brand { const brand: Brand = { ...sample, legalName: sample.legalName ?? sample.name }; for (const { key } of brandVariables) { const value = fromEnvironment[key]?.trim(); if (value) brand[key] = value; } if (fromEnvironment.name?.trim() && !fromEnvironment.legalName?.trim()) brand.legalName = brand.name; return brand;}/** A `tel:` link for a phone number written for people. */export function telHref(phone: string) { return `tel:${phone.replace(/[^\d+]/g, "")}`;}/** The first letter of the name, for a monogram mark. */export function monogram(name: string) { return name.trim().charAt(0).toUpperCase();}