Skip to content

Inverted pattern hero

A dark hero with a drawn grid and a radial mask instead of a gradient.

Marketingstarterheroinvertedpatterndark

Live preview

full widthLive preview — open it in a new tab for the full-height version.
Open the preview in a new tab

Source

This exact file renders the preview above.

import { ArrowRight } from 'lucide-react'
import { ButtonLink } from '@/components/ui/button'
import { Container } from '@/components/ui/layout'
import { Badge } from '@/components/ui/badge'

/**
 * Inverted hero with a drawn pattern
 *
 * Depth without a gradient: a CSS grid-paper layer plus a radial mask. The
 * whole treatment is two background-image declarations and costs no bytes,
 * which matters more on a hero than anywhere else on the page.
 */
export default function InvertedPatternHero() {
  return (
    <section className="relative overflow-hidden bg-surface-inverse text-ink-inverse">
      <div
        className="grid-paper absolute inset-0 opacity-50 [mask-image:radial-gradient(ellipse_at_center,black,transparent_75%)]"
        aria-hidden="true"
      />

      <Container className="relative py-section">
        <div className="mx-auto max-w-3xl text-center">
          <Badge appearance="outline" className="mx-auto border-white/25 text-current">
            One system, five palettes
          </Badge>
          <h2 className="display-type mt-6 text-4xl leading-[1.08] font-semibold sm:text-5xl lg:text-6xl">
            Every surface, every state, every scheme.
          </h2>
          <p className="mx-auto mt-5 max-w-xl text-md opacity-80 sm:text-lg">
            Light and dark are authored separately. Palette and density are separate axes again. All
            three compose, and all three persist.
          </p>
          <div className="mt-9 flex flex-wrap items-center justify-center gap-3">
            <ButtonLink
              href="/playground"
              variant="secondary"
              size="lg"
              trailingIcon={<ArrowRight className="size-4" />}
            >
              Open the playground
            </ButtonLink>
            <ButtonLink
              href="/docs/design-tokens"
              variant="ghost"
              size="lg"
              className="text-current hover:bg-white/10"
            >
              Read the token reference
            </ButtonLink>
          </div>
        </div>
      </Container>
    </section>
  )
}

components/blocks/sections/hero/inverted-pattern.tsx

import { ArrowRight } from 'lucide-react'
import { ButtonLink } from '@/components/ui/button'
import { Container } from '@/components/ui/layout'
import { Badge } from '@/components/ui/badge'

/**
 * Inverted hero with a drawn pattern
 *
 * Depth without a gradient: a CSS grid-paper layer plus a radial mask. The
 * whole treatment is two background-image declarations and costs no bytes,
 * which matters more on a hero than anywhere else on the page.
 */
export default function InvertedPatternHero() {
  return (
    <section className="relative overflow-hidden bg-surface-inverse text-ink-inverse">
      <div
        className="grid-paper absolute inset-0 opacity-50 [mask-image:radial-gradient(ellipse_at_center,black,transparent_75%)]"
        aria-hidden="true"
      />

      <Container className="relative py-section">
        <div className="mx-auto max-w-3xl text-center">
          <Badge appearance="outline" className="mx-auto border-white/25 text-current">
            One system, five palettes
          </Badge>
          <h2 className="display-type mt-6 text-4xl leading-[1.08] font-semibold sm:text-5xl lg:text-6xl">
            Every surface, every state, every scheme.
          </h2>
          <p className="mx-auto mt-5 max-w-xl text-md opacity-80 sm:text-lg">
            Light and dark are authored separately. Palette and density are separate axes again. All
            three compose, and all three persist.
          </p>
          <div className="mt-9 flex flex-wrap items-center justify-center gap-3">
            <ButtonLink
              href="/playground"
              variant="secondary"
              size="lg"
              trailingIcon={<ArrowRight className="size-4" />}
            >
              Open the playground
            </ButtonLink>
            <ButtonLink
              href="/docs/design-tokens"
              variant="ghost"
              size="lg"
              className="text-current hover:bg-white/10"
            >
              Read the token reference
            </ButtonLink>
          </div>
        </div>
      </Container>
    </section>
  )
}

components/ui/badge.tsx

import type { HTMLAttributes, ReactNode } from 'react'
import { variants } from '@/lib/variants'

/**
 * Badge
 *
 * A compact, non-interactive label. Tones map to the status token trios, and
 * because a badge is often the only signal in a dense table, the `dot` option
 * exists to add a second, colour-independent cue alongside the text.
 */
const badgeVariants = variants('inline-flex items-center gap-1.5 whitespace-nowrap font-medium', {
  variants: {
    tone: {
      neutral: 'bg-surface-sunken text-ink-muted border-line',
      accent: 'bg-accent-soft text-accent-soft-ink border-accent-line',
      success: 'bg-success-soft text-success border-success-line',
      warning: 'bg-warning-soft text-warning border-warning-line',
      danger: 'bg-danger-soft text-danger border-danger-line',
      info: 'bg-info-soft text-info border-info-line',
      inverse: 'bg-surface-inverse text-ink-inverse border-transparent',
    },
    appearance: {
      soft: 'border',
      outline: 'border bg-transparent',
      solid: 'border border-transparent',
    },
    size: {
      sm: 'h-4.5 rounded-sm px-1.5 text-2xs',
      md: 'h-5.5 rounded-sm px-2 text-xs',
    },
  },
  defaultVariants: { tone: 'neutral', appearance: 'soft', size: 'md' },
  compound: [
    { appearance: 'solid', tone: 'accent', class: 'bg-accent text-accent-ink' },
    { appearance: 'solid', tone: 'success', class: 'bg-success text-white' },
    { appearance: 'solid', tone: 'warning', class: 'bg-warning text-white' },
    { appearance: 'solid', tone: 'danger', class: 'bg-danger text-white' },
    { appearance: 'solid', tone: 'info', class: 'bg-info text-white' },
    { appearance: 'solid', tone: 'neutral', class: 'bg-ink text-ink-inverse' },
    { appearance: 'outline', tone: 'neutral', class: 'text-ink-muted' },
  ],
})

export type BadgeTone = 'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info' | 'inverse'

export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
  tone?: BadgeTone
  appearance?: 'soft' | 'outline' | 'solid'
  size?: 'sm' | 'md'
  /** Adds a leading dot so the badge does not rely on hue alone. */
  dot?: boolean
  icon?: ReactNode
}

export function Badge({
  tone = 'neutral',
  appearance = 'soft',
  size = 'md',
  dot = false,
  icon,
  className,
  children,
  ...props
}: BadgeProps) {
  return (
    <span className={badgeVariants({ tone, appearance, size, className })} {...props}>
      {dot ? (
        <span className="size-1.5 shrink-0 rounded-full bg-current" aria-hidden="true" />
      ) : null}
      {icon}
      {children}
    </span>
  )
}

Demo source — adapt to your project. Foundry is not published as a package.

Usage

Depth without a gradient: two background-image declarations that cost no bytes and re-theme with the border token.

  • Masks are cheaper and sharper than a blurred image for this effect.
  • Keep body copy at 80% opacity, not lower — inverted text loses legibility fast.

Variants and states

Every entry below is a genuine difference in behaviour or layout, and every one of them is visible in the preview above.

  • Grid-paper layer
  • Radial mask
  • Centred content

Accessibility

Decorative layer
The pattern is aria-hidden and non-interactive.
Token-driven contrast
Foreground uses ink-inverse, so contrast survives a palette change.

Foundry implements published ARIA patterns and is tested against them. No WCAG certification is claimed — see the accessibility documentation for what is and is not covered.