Legal Page React template for Tailwind CSS v4
v1.1.0Updated in 1.9.0
Terms, privacy, cookie and data processing pages in one template: a document switcher, a plain-English summary and numbered sections.
Switch between Terms, Privacy, Cookies and DPA in the pill row at the top (links to /legal/terms, /legal/privacy...; the thumb slides to the current one). Each document opens with its dates, a Download PDF and a Print action (both open the print dialog unless onDownload / onPrint are set; header, footer and navigation are hidden in print), and a short plain-English summary. On desktop the sticky On this page list follows your reading position and jumps to a section on click; arrow keys, Home and End move between its links. On phones it becomes a pill pinned under the header that shows the current section and opens a bottom sheet with every section. Every section heading has a copy button that copies its link (/legal/privacy#your-rights) and confirms with a check. Links inside the text to another document switch to it. Tables (sub-processors, retention, cookies) turn into one card per row below 768px. The page ends with a contact card: email legal@acme.com, copy the address, or read the postal address. The hero rises in once on mount; reduced motion keeps it still.
Legal Page is a Pro React template in the React website templates category, written in TypeScript for React 19 and Tailwind CSS v4. It installs as source with npx wingo-ui@latest add legal-page, together with Marketing Header, Marketing Footer, Marketing Section, Button, Copy Button and 6 more and the npm packages motion and lucide-react.
Built with
The sections this page is made of. In the full-screen preview, hold Alt to outline each one on the page.
Add to a project
Requirements: React 19 and Tailwind CSS v4, in Next.js (App Router or Pages), Vite or React Router. Installation guide · Next.js setup · Vite setup
npx wingo-ui@latest add legal-pageLegal Page is part of Pro, with 298 more Pro items: $8 a month or $150 once. 14-day refund before you download any Pro item. See plans
Usage
Import LegalPage from @/components/templates/legal-page.
// app/(marketing)/legal/[doc]/page.tsx
import Link from "next/link"
import { notFound } from "next/navigation"
import { LegalPage } from "@/components/templates/legal-page"
import { LEGAL_DOCUMENTS } from "@/components/templates/legal-page-data"
export function generateStaticParams() {
return LEGAL_DOCUMENTS.map((doc) => ({ doc: doc.id }))
}
export default async function LegalRoute({ params }: { params: Promise<{ doc: string }> }) {
const { doc } = await params
if (!LEGAL_DOCUMENTS.some((item) => item.id === doc)) notFound()
return <LegalPage linkComponent={Link} doc={doc} contactEmail="legal@acme.com" />
}Props
documentsdefault"LEGAL_DOCUMENTS"LegalDocument[]The documents: { id, label, title, description, href, updated, effective, summary, sections }. A section's body is an array of simple blocks (paragraph, heading, list, definitions, table, note) or your own React content.
docstringThe id of the document shown, controlled; pair it with onDocChange or set it per route.
defaultDocdefault"terms"stringThe document shown first while uncontrolled.
onDocChange(doc: string) => voidCalled when the switcher or a link in the text picks another document.
contactdefault"LEGAL_CONTACT"LegalContact{ email, company, address } for the contact card at the end.
contactEmaildefault""stringReplaces contact.email.
designdefault"classic""classic" | "editorial" | "minimal"The whole page's look. classic: a pill switcher, raised summary, definition and table cards and a soft contact card; editorial: a centered header, a large start-aligned title over a heavy rule, underline tabs, the summary and sections divided by hairlines, open tables, italic notes on a side rule and a centered footer; minimal: a transparent header, a smaller title, a plain switcher, the summary as a quiet side rule, outlined tables, a plain table of contents, extra air and a simple footer. headerProps, footerProps and classNames still win.
backgrounddefault"soft""plain" | "soft" | "glow" | "aurora" | "grid" | "dots"The main background: plain is the bare page color; the others tint the page and add a glow, an aurora, a grid or dots over the first screen. A design picks its own unless you set one. classic uses soft, editorial plain, minimal dots.
backgroundColordefault"oklch(0.62 0.14 275)"stringThe tint and glow color of the main background.
numbereddefaulttruebooleanNumbers the section headings and the table of contents.
showSummarydefaulttruebooleanThe "The short version" box above the sections.
showTocdefaulttruebooleanThe sticky table of contents (a pill and sheet on phones).
showActionsdefaulttruebooleanThe Download PDF and Print buttons.
showContactdefaulttruebooleanThe contact card at the end.
tocVariantdefault"line""line" | "dots" | "plain"The look of the table of contents. Applies to the classic design.
tonedefault"neutral""neutral" | "brand" | "success" | "warning" | "danger" | "info"The table of contents indicator and the summary checks.
headerdefaulttruebooleanThe sticky marketing header; turn it off inside a site layout.
footerdefaulttruebooleanThe marketing footer.
headerPropsPartial<MarketingHeaderProps>Passed to MarketingHeader (currentPath defaults to the document's href).
footerPropsPartial<MarketingFooterProps>Passed to MarketingFooter.
onDownload(doc: LegalDocument) => voidThe Download PDF action; without it the print dialog opens (Save as PDF).
onPrint(doc: LegalDocument) => voidThe Print action; default window.print().
localedefault"en-US"stringIntl locale for the dates.
animateIndefaulttruebooleanThe hero rises in once on mount; off in thumbnails.
linkComponentdefault"<a>"(props: LinkComponentProps) => ReactNodeThe router link for every link (next/link in an app).
labelsPartial<LegalPageLabels>Every visible string; English defaults in DEFAULT_LEGAL_PAGE_LABELS.
classNamestringClasses for the root.
classNamesPartial<Record<LegalPageSlot, string>>Classes for hero, switcher, meta, actions, toc, article, summary, section, sectionTitle and contact.
Parts
LegalBlocks
componentRenders a section's simple blocks: paragraphs, subheadings, lists, definitions, tables (cards on phones) and notes. Takes div props.
blocksLegalBlock[]The blocks to render.
linkComponent(props: LinkComponentProps) => ReactNodeThe router link for links in the text.
onLink(event, href: string) => voidCalled when a link in the text is clicked.
LegalText
componentInline text with **bold**, [label](href) links and bare email addresses turned into mailto links.
textstringThe text to render.
linkComponent(props: LinkComponentProps) => ReactNodeThe router link for links.
onLink(event, href: string) => voidCalled when a link is clicked.
LEGAL_DOCUMENTS
constantThe sample Terms of Service, Privacy Policy, Cookie Policy and Data Processing Addendum for Acme.
LEGAL_CONTACT
constantThe sample contact: legal@acme.com and a New York postal address.
LEGAL_PAGE_SAMPLE
constant{ documents, contact } in one object.
DEFAULT_LEGAL_PAGE_LABELS
constantThe English strings.
LEGAL_PAGE_DESIGNS
constantThe design names, classic first: ["classic", "editorial", "minimal"].
LegalPageDesign
type"classic" | "editorial" | "minimal".
LegalDocument
typeA document: id, label, title, description, href, updated, effective, summary and sections.
LegalSection
type{ id, title, body }: the id is the anchor, body is LegalBlock[] or a ReactNode.
LegalBlock
typeparagraph | heading | list | definitions | table | note.
LegalContact
type{ email, company, address }.
LegalPageProps
typeProps of LegalPage: the documents, design, contact details and div attributes.
Examples
Editorial design
design="editorial": a centered header, large start-aligned type over a heavy rule, underline tabs, hairlines between sections and open tables.
Minimal design
design="minimal": a transparent header, a smaller title, the summary as a quiet side rule, outlined tables, no cards and a simple footer.
Privacy policy
Opens on the privacy policy: purposes, the sub-processors table (cards on phones), GDPR and CCPA rights, retention and cookies.
Cookie policy, brand accents
The cookie policy with dotted contents and brand-orange checks and indicator.
Inside a site layout
No header or footer and no summary: the document alone under your own site chrome.
Single column, British dates
Without the table of contents or numbers: one 720px reading column, dates in en-GB.
Dependencies
Files
- components/templates/legal-page.tsx
- components/templates/legal-page-data.ts
FAQ
Is the React Legal Page template free?
The preview, props and docs are free; copying the source needs a Pro plan. See plans.
How do I install Legal Page?
Run npx wingo-ui@latest add legal-page. It also adds the Wingo UI items it builds on (Marketing Header, Marketing Footer, Marketing Section, Button, Copy Button and 6 more) and the npm packages motion and lucide-react. With shadcn, add the @wingo-ui registry with your API key, then run npx shadcn@latest add @wingo-ui/legal-page.
How does Legal Page behave on phones?
On phones it becomes a pill pinned under the header that shows the current section and opens a bottom sheet with every section. Tables (sub-processors, retention, cookies) turn into one card per row below 768px.
See also
Related guides
- SaaS Website Template: The 7 Pages Beyond the Home Page
Build it: screens and apps20 min read
New components by email
New posts, product news and occasional offers from Wingo UI. We count clicks to keep it relevant.