Pages

Legal page

The site's legal pages (terms, privacy): the header, the page head with the title, the lead and the ASCII drift, then the text in the head's columns (the sections at the 640px measure on the left, their list staying in view on the right) and the footer.

Install

React apps get the React files; every other stack gets the web component.

npx spyglass-ds add legal-page
<script type="module" src="/spyglass-ds/elements/legal-page.js"></script>
Terms

Terms of service

The terms for using the service, in plain words. Questions about them go to the contact at the end.

Last updated Nov 1, 2026

Who we are

This section covers who provides the service and how to reach them. Replace this text with the terms your counsel approves.

Your account

This section covers creating an account, keeping it secure and who may use it. Replace this text with the terms your counsel approves.

Each section can hold as many paragraphs as it needs.

Using the service

This section covers what the service may and may not be used for. Replace this text with the terms your counsel approves.

Plans and payment

This section covers plans, billing, renewals and refunds. Replace this text with the terms your counsel approves.

Ending the agreement

This section covers how either side may end the agreement and what happens to data. Replace this text with the terms your counsel approves.

Contact

This section covers where to send questions about these terms. Replace this text with the terms your counsel approves.

Privacy policy

Privacy policy

What we collect, why we keep it and the choices you have about it.

Last updated Nov 1, 2026

What we collect

This section covers the information you give us and what the service records as you use it. Replace this text with the policy your counsel approves.

How we use it

This section covers why the information is used and the grounds for using it. Replace this text with the policy your counsel approves.

Who we share it with

This section covers the providers that help run the service and when the law asks for information. Replace this text with the policy your counsel approves.

How long we keep it

This section covers how long each kind of information is kept and how it is deleted. Replace this text with the policy your counsel approves.

Your choices

This section covers seeing, correcting, exporting and deleting your information. Replace this text with the policy your counsel approves.

Contact

This section covers where to send questions about this policy. Replace this text with the policy your counsel approves.

Text on its way

Usage

Terms of service, privacy, cookies. page picks the terms or the privacy copy; preparing shows only the head, its lead saying the text is on its way (the site's state until the text is ready); the text is a placeholder: put what your counsel approves in lib/pages/legal.ts or pass content.

Never

  • Shipping the placeholder text
  • Text set in gray or under 16px: the sections read in White at 16/24
  • A display-size title: the page head's section head

sections lists the sections to show, in order (head, body); a key left out is not shown. menus passes the header menus (the live card's picture, the use cases' shots).

Adds with it: ascii-trail, creative-card, page-head, site-footer, site-header

Props

The web component takes the same as attributes or properties (<spyglass-legal-page>); title is heading there.

<LegalPage>

PropTypeDefault
page'terms' | 'privacy'

Which page's copy to show when there is no `content`: terms or privacy.

'terms'
contentLegalContent
preparingboolean

Only the page head, its lead saying the text is being prepared (the site's pages until the text is ready).

false
menusHeaderMenus

The header menus' content, pictures included (the live card's `picture`, the use cases' `shots`); Acme by default.

sectionsreadonly LegalSection[]

The sections to show, in order; all of them in the page order by default (leave one out to omit it).

classNamestring

Examples

The same example in React and as web components; both render identically.

react/examples/legal-page/Page.tsx
import { LegalPage } from '@/react/components/pages/LegalPage'
// The terms page as the site sets its legal pages, with placeholder sections to replace.

export default function Page() {
  return <LegalPage />
}
elements/examples/legal-page/Page.html
<!-- The terms page as the site sets its legal pages, with placeholder sections to replace. -->
<spyglass-legal-page></spyglass-legal-page>
react/examples/legal-page/Privacy.tsx
import { LegalPage } from '@/react/components/pages/LegalPage'
// The privacy policy: the same page with its own head and sections.

export default function Privacy() {
  return <LegalPage page="privacy" />
}
elements/examples/legal-page/Privacy.html
<!-- The privacy policy: the same page with its own head and sections. -->
<spyglass-legal-page page="privacy"></spyglass-legal-page>
react/examples/legal-page/Preparing.tsx
import { LegalPage } from '@/react/components/pages/LegalPage'
// While the text is being prepared: only the page head, its lead saying the privacy policy is on its way.

export default function Preparing() {
  return <LegalPage page="privacy" preparing />
}
elements/examples/legal-page/Preparing.html
<!-- While the text is being prepared: only the page head, its lead saying the privacy policy is on its way. -->
<spyglass-legal-page page="privacy" preparing></spyglass-legal-page>

Source

react/components/pages/LegalPage.tsx
import { SiteHeader } from '@/react/components/site/SiteHeader'
import { AsciiTrail } from '@/react/components/visuals/AsciiTrail'
import { PageHead } from '@/react/components/site/PageHead'
import { SiteFooter } from '@/react/components/blocks/SiteFooter'
import { legalContent, legalPrivacyContent, type LegalContent, legalSections, type LegalSection } from '@/lib/pages/legal'
import { cn } from '@/react/lib/cn'
import { pageSections } from '@/lib/image'
import { Fragment, type ReactNode } from 'react'
import type { HeaderMenus } from '@/lib/site-header'

// The site's legal pages (app/terms, app/privacy): the header, the page head (the title, the lead and the ASCII drift
// in the right columns), then the text in the head's columns: the sections in the left seven at the 640px measure (a
// subhead, 20/24 and 24/28 from 768, over 16/24 paragraphs in White, 40px between sections) and, from 768, the list of
// them in the right five, staying in view as the text scrolls (above the text on phones). The section padding under it,
// then the footer. The text is a placeholder for what your counsel approves: `content` replaces it (lib/pages/legal.ts;
// `page="privacy"` takes the privacy policy's). `preparing` shows only the head, its lead saying the text is on its way,
// as the site does until the text is ready.
export interface LegalPageProps {
  /** Which page's copy to show when there is no `content`: terms or privacy. */
  page?: 'terms' | 'privacy'
  content?: LegalContent
  /** Only the page head, its lead saying the text is being prepared (the site's pages until the text is ready). */
  preparing?: boolean
  /** The header menus' content, pictures included (the live card's `picture`, the use cases' `shots`); Acme by default. */
  menus?: HeaderMenus
  /** The sections to show, in order; all of them in the page order by default (leave one out to omit it). */
  sections?: readonly LegalSection[]
  className?: string
}

const CONTAINER = 'mx-auto w-full max-w-[calc(var(--ds-layout-content)+2*var(--ds-layout-gutter))] px-(--ds-layout-gutter)'

export function LegalPage({ page = 'terms', content, preparing = false, menus, sections, className }: LegalPageProps) {
  const c = content ?? (page === 'privacy' ? legalPrivacyContent : legalContent)
  const parts: Record<LegalSection, ReactNode> = {
    head: <PageHead id={c.id} lines={[c.title]} lead={preparing ? c.preparing : c.lead} />,
    body: (
      preparing ? null : <div className={cn(CONTAINER, 'grid grid-cols-[minmax(0,1fr)] gap-12 pb-(--ds-layout-section) md:grid-cols-[minmax(0,7fr)_minmax(0,5fr)] lg:gap-16')}>
        <nav aria-label={c.contents} className="self-start md:sticky md:top-[calc(var(--ds-size-header)+var(--ds-space-2xl))] md:order-last">
          <p className="mb-4 type-label text-fg-muted">{c.contents}</p>
          <ul role="list" className="grid gap-2">
            {c.sections.map((s) => <li key={s.id}><a href={`#${s.id}`} className="rounded-ds-sm type-ui text-fg-soft transition-[color] duration-160 ease-out hover:text-fg">{s.title}</a></li>)}
          </ul>
        </nav>
        <div className="grid max-w-measure gap-10">
          <p className="type-ui text-fg-muted">{c.updated}</p>
          {c.sections.map((s) => (
            <section key={s.id} id={s.id} aria-labelledby={`${s.id}-title`} className="grid scroll-mt-[calc(var(--ds-size-header)+var(--ds-space-2xl))] gap-4">
              <h2 id={`${s.id}-title`} className="type-heading-4 text-balance md:type-heading-3">{s.title}</h2>
              {s.body.map((p) => <p key={p} className="type-body text-pretty text-fg">{p}</p>)}
            </section>
          ))}
        </div>
      </div>
    ),
  }
  return (
    <div data-ds="legal-page" className={cn('isolate bg-surface text-fg', className)}>
      <AsciiTrail mode="page" />
      <SiteHeader menus={menus} links={c.shell.header.nav} secondary={c.shell.header.secondary} cta={c.shell.header.cta} />
      <main id="main">
        {pageSections(legalSections, sections).map((k) => <Fragment key={k}>{parts[k]}</Fragment>)}
      </main>
      <SiteFooter columns={c.shell.footer.columns} legal={c.shell.footer.legal} />
    </div>
  )
}

export default LegalPage
lib/pages/legal.ts
// The legal pages' copy (site app/terms and app/privacy): the page head's title and lead, the date the text changed,
// and the sections with neutral placeholder text to replace with what your counsel approves. Both flavors read this file.

// The header's five pages and the sign-in, the footer's six columns and Acme's legal line.
const shell = {
	header: {
		nav: [
			{ label: 'Products', href: '/products' },
			{ label: 'Use cases', href: '/use-cases' },
			{ label: 'Enterprise', href: '/enterprise' },
			{ label: 'Resources', href: '/resources' },
			{ label: 'Pricing', href: '/pricing' },
		],
		secondary: { label: 'Sign in', href: '/sign-in' },
		// The site shows the header's White button on pages whose head has no button of its own.
		cta: { label: 'Get a free API key', href: '/sign-up', short: 'Get API key' },
	},
	footer: {
		columns: [
			{ title: 'Products', wide: true, links: [{ label: 'Brands and creators', href: '/products/brand-search' }, { label: 'Media archive', href: '/products/media-search' }, { label: 'Collaborations', href: '/products/creator-collabs' }, { label: 'Creative insights', href: '/products/creative-insights' }, { label: 'Realtime search', href: '/products/realtime-search' }, { label: 'Coming soon', href: '/products' }] },
			{ title: 'Use cases', wide: true, links: [{ label: 'Build your own', href: '/use-cases/build' }, { label: 'Creative research', href: '/use-cases/creative-research' }, { label: 'Paid ads', href: '/use-cases/paid-ads' }, { label: 'Organic social', href: '/use-cases/organic-social' }, { label: 'Competitive analysis', href: '/use-cases/competitive-analysis' }, { label: 'Creator sourcing', href: '/use-cases/creator-sourcing' }] },
			{ title: 'Resources', links: [{ label: 'Templates', href: '/templates' }, { label: 'Docs', href: '/docs' }, { label: 'Blog', href: '/resources/blog' }, { label: 'Articles', href: '/resources/articles' }] },
			{ title: 'Company', links: [{ label: 'Enterprise', href: '/enterprise' }, { label: 'About', href: '/about' }, { label: 'Careers', href: '/about#careers' }, { label: 'Talk to us', href: '/enterprise#talk' }, { label: 'Sign in', href: '/sign-in' }] },
			{ title: 'Legal', links: [{ label: 'Terms', href: '/terms' }, { label: 'Privacy', href: '/privacy' }] },
			{ title: 'Community', links: [{ label: 'X', href: 'https://x.com' }, { label: 'LinkedIn', href: 'https://linkedin.com' }, { label: 'Instagram', href: 'https://instagram.com' }] },
		],
		legal: '© 2026 Acme Inc.',
	},
}

const placeholder = (what: string) => `This section covers ${what}. Replace this text with the terms your counsel approves.`

export const legalContent = {
	shell,
	id: 'terms',
	title: 'Terms of service',
	lead: 'The terms for using the service, in plain words. Questions about them go to the contact at the end.',
	/** The lead while the text is being prepared (`preparing`): the page shows only its head. */
	preparing: 'The updated terms of service are being prepared. They will be published on this page when they are ready.',
	updated: 'Last updated Nov 1, 2026',
	contents: 'On this page',
	sections: [
		{ id: 'who-we-are', title: 'Who we are', body: [placeholder('who provides the service and how to reach them')] },
		{ id: 'your-account', title: 'Your account', body: [placeholder('creating an account, keeping it secure and who may use it'), 'Each section can hold as many paragraphs as it needs.'] },
		{ id: 'using-the-service', title: 'Using the service', body: [placeholder('what the service may and may not be used for')] },
		{ id: 'plans-and-payment', title: 'Plans and payment', body: [placeholder('plans, billing, renewals and refunds')] },
		{ id: 'ending', title: 'Ending the agreement', body: [placeholder('how either side may end the agreement and what happens to data')] },
		{ id: 'contact', title: 'Contact', body: [placeholder('where to send questions about these terms')] },
	],
}

export type LegalContent = typeof legalContent

const privacy = (what: string) => `This section covers ${what}. Replace this text with the policy your counsel approves.`

/** The privacy policy's head and sections, in the same shape. */
export const legalPrivacyContent: LegalContent = {
	...legalContent,
	id: 'privacy',
	title: 'Privacy policy',
	lead: 'What we collect, why we keep it and the choices you have about it.',
	preparing: 'The updated privacy policy is being prepared. It will be published on this page when it is ready.',
	sections: [
		{ id: 'what-we-collect', title: 'What we collect', body: [privacy('the information you give us and what the service records as you use it')] },
		{ id: 'how-we-use-it', title: 'How we use it', body: [privacy('why the information is used and the grounds for using it')] },
		{ id: 'sharing', title: 'Who we share it with', body: [privacy('the providers that help run the service and when the law asks for information')] },
		{ id: 'keeping-it', title: 'How long we keep it', body: [privacy('how long each kind of information is kept and how it is deleted')] },
		{ id: 'your-choices', title: 'Your choices', body: [privacy('seeing, correcting, exporting and deleting your information')] },
		{ id: 'contact', title: 'Contact', body: [privacy('where to send questions about this policy')] },
	],
}

/** The legal page's sections in order; pass `sections` to reorder them or leave some out. */
export const legalSections = ['head', 'body'] as const
export type LegalSection = (typeof legalSections)[number]
react/lib/cn.ts
// Joins class names, skipping falsy ones: cn('a', on && 'b', ['c', undefined]). It does not merge conflicting
// utilities (no tailwind-merge), as Vue's class binding does not: the library's classes are written not to compete,
// and a className from the caller is appended after them, as Vue appends a fallthrough class.
export type ClassValue = string | false | null | undefined | 0 | ClassValue[]

export function cn(...values: ClassValue[]): string {
	const out: string[] = []
	for (const v of values) {
		if (!v) continue
		if (Array.isArray(v)) {
			const s = cn(...v)
			if (s) out.push(s)
		}
		else out.push(v)
	}
	return out.join(' ')
}
elements/components/pages/legal-page.ts
import { html, nothing } from 'lit'
import { DsElement, define, HostLayoutController } from '@/elements/lib/element'
import { legalContent, legalPrivacyContent, type LegalContent, legalSections, type LegalSection } from '@/lib/pages/legal'
import '@/elements/components/site/site-header'
import '@/elements/components/site/page-head'
import '@/elements/components/blocks/site-footer'
import '@/elements/components/visuals/ascii-trail'
import styles from 'virtual:tw'
import { pageSections } from '@/lib/image'
import { headerMenus, type HeaderMenus } from '@/lib/site-header'

// LegalPage.tsx as <spyglass-legal-page>: the header, the page head, the sections in the left columns and their list
// staying in view in the right ones, then the footer. The sections live in the shadow root, where the page's #fragment
// cannot reach them, so the list scrolls to them itself (and puts the fragment in the address bar). `page` picks terms or privacy;
// `content` replaces the text.
const CONTAINER = 'mx-auto w-full max-w-[calc(var(--ds-layout-content)+2*var(--ds-layout-gutter))] px-(--ds-layout-gutter)'

/**
 * @summary The legal page (terms, privacy).
 */
export class LegalPage extends DsElement {
	static styles = [DsElement.styles, styles]
	protected readonly layout = new HostLayoutController(this, () => this.renderRoot.querySelector<HTMLElement>('[data-ds="legal-page"]'))
	static properties = { page: {}, content: { type: Object }, preparing: { type: Boolean }, menus: { type: Object }, sections: { type: Array } }
	/** Which page's copy to show when there is no `content`: terms or privacy. */
	page: 'terms' | 'privacy' = 'terms'
	/** Only the page head, its lead saying the text is being prepared. */
	preparing = false
	/** The text as JSON (lib/pages/legal.ts by default). */
	content?: LegalContent
	/** The header menus' content, pictures included (the live card's `picture`, the use cases' `shots`); Acme by default. */
	menus?: HeaderMenus
	/** The sections to show, in order (a list of names); all of them in the page order by default. */
	sections?: LegalSection[]

	private go(event: Event, id: string) {
		const target = (this.renderRoot as ShadowRoot).getElementById(id)
		if (!target) return
		event.preventDefault()
		target.scrollIntoView()
		history.replaceState(null, '', `#${id}`)
	}

	render() {
		const c = this.content ?? (this.page === 'privacy' ? legalPrivacyContent : legalContent)
		const parts: Record<LegalSection, unknown> = {
			head: html`<spyglass-page-head head-id=${c.id} .lines=${[c.title]} .lead=${this.preparing ? c.preparing : c.lead}></spyglass-page-head>`,
			body: html`${this.preparing ? nothing : html`<div class=${`${CONTAINER} grid grid-cols-[minmax(0,1fr)] gap-12 pb-(--ds-layout-section) md:grid-cols-[minmax(0,7fr)_minmax(0,5fr)] lg:gap-16`}><nav aria-label=${c.contents} class="self-start md:sticky md:top-[calc(var(--ds-size-header)+var(--ds-space-2xl))] md:order-last"><p class="mb-4 type-label text-fg-muted">${c.contents}</p><ul role="list" class="grid gap-2">${c.sections.map((s) => html`<li><a href=${`#${s.id}`} class="rounded-ds-sm type-ui text-fg-soft transition-[color] duration-160 ease-out hover:text-fg" @click=${(e: Event) => this.go(e, s.id)}>${s.title}</a></li>`)}</ul></nav><div class="grid max-w-measure gap-10"><p class="type-ui text-fg-muted">${c.updated}</p>${c.sections.map((s) => html`<section id=${s.id} aria-labelledby=${`${s.id}-title`} class="grid scroll-mt-[calc(var(--ds-size-header)+var(--ds-space-2xl))] gap-4"><h2 id=${`${s.id}-title`} class="type-heading-4 text-balance md:type-heading-3">${s.title}</h2>${s.body.map((p) => html`<p class="type-body text-pretty text-fg">${p}</p>`)}</section>`)}</div></div>`}`,
		}
		return html`<div data-ds="legal-page" class="isolate bg-surface text-fg"><spyglass-ascii-trail mode="page"></spyglass-ascii-trail><spyglass-site-header .menus=${this.menus ?? headerMenus} .links=${c.shell.header.nav} .secondary=${c.shell.header.secondary} .cta=${c.shell.header.cta}></spyglass-site-header><main id="main">${pageSections(legalSections, this.sections).map((k) => parts[k])}</main><spyglass-site-footer .columns=${c.shell.footer.columns} legal=${c.shell.footer.legal}></spyglass-site-footer></div>`
	}
}

define('legal-page', LegalPage)

Reference: Site app/terms and app/privacy (AsciiTrail, Header, PageHead with the title and the 'being prepared' lead, Footer: the `preparing` state); the text in the site's type: .t-sub subheads (h6, h5 from 768), 16/24 paragraphs in --text at --measure, the page head's 7fr and 5fr columns; --section-y under it.