Skip to content

Two-audience hero

A fork in the road for products with two genuinely different buyers.

Marketingstarterherosegmentationaudiencecards

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, Code2, PenTool } from 'lucide-react'
import Link from 'next/link'
import { Container } from '@/components/ui/layout'

/**
 * Two-audience hero
 *
 * A fork in the road for products with two genuinely different buyers. Each
 * path is a full card link with its own promise, rather than one headline
 * trying to speak to both — which usually speaks to neither.
 */
const paths = [
  {
    icon: Code2,
    audience: 'For engineers',
    title: 'Source you can read and own',
    description:
      'Copy a component in, keep it in your repository, change it when you need to. No package to upgrade, no black box.',
    href: '/docs/installation',
    cta: 'Read the installation guide',
  },
  {
    icon: PenTool,
    audience: 'For designers',
    title: 'Tokens that survive handover',
    description:
      'One manifest of colour, type, spacing and density that maps directly to variables — and to what actually ships.',
    href: '/docs/design-tokens',
    cta: 'See the token reference',
  },
]

export default function TwoAudienceHero() {
  return (
    <section className="border-b border-line bg-canvas py-section">
      <Container>
        <div className="mx-auto max-w-2xl text-center">
          <h2 className="display-type text-3xl leading-tight font-semibold text-ink-strong sm:text-4xl">
            Where would you like to start?
          </h2>
          <p className="mx-auto mt-4 max-w-lg text-md text-ink-muted">
            Foundry is used by two people who want different things from it on day one.
          </p>
        </div>

        <div className="mt-12 grid gap-4 md:grid-cols-2">
          {paths.map((path) => {
            const Icon = path.icon
            return (
              <Link
                key={path.href}
                href={path.href}
                className="group flex flex-col rounded-xl border border-line bg-surface p-6 transition-[border-color,box-shadow] duration-150 hover:border-accent hover:shadow-md sm:p-8"
              >
                <span className="flex size-10 items-center justify-center rounded-lg bg-accent-soft text-accent-soft-ink">
                  <Icon className="size-5" aria-hidden="true" />
                </span>
                <p className="label-caps mt-5 text-ink-subtle">{path.audience}</p>
                <h3 className="display-type mt-2 text-xl font-semibold text-ink-strong">
                  {path.title}
                </h3>
                <p className="mt-3 flex-1 text-sm leading-relaxed text-ink-muted">
                  {path.description}
                </p>
                <span className="mt-6 inline-flex items-center gap-1.5 text-sm font-semibold text-accent">
                  {path.cta}
                  <ArrowRight
                    className="size-4 transition-transform duration-150 group-hover:translate-x-0.5"
                    aria-hidden="true"
                  />
                </span>
              </Link>
            )
          })}
        </div>
      </Container>
    </section>
  )
}

components/blocks/sections/hero/two-audience.tsx

import { ArrowRight, Code2, PenTool } from 'lucide-react'
import Link from 'next/link'
import { Container } from '@/components/ui/layout'

/**
 * Two-audience hero
 *
 * A fork in the road for products with two genuinely different buyers. Each
 * path is a full card link with its own promise, rather than one headline
 * trying to speak to both — which usually speaks to neither.
 */
const paths = [
  {
    icon: Code2,
    audience: 'For engineers',
    title: 'Source you can read and own',
    description:
      'Copy a component in, keep it in your repository, change it when you need to. No package to upgrade, no black box.',
    href: '/docs/installation',
    cta: 'Read the installation guide',
  },
  {
    icon: PenTool,
    audience: 'For designers',
    title: 'Tokens that survive handover',
    description:
      'One manifest of colour, type, spacing and density that maps directly to variables — and to what actually ships.',
    href: '/docs/design-tokens',
    cta: 'See the token reference',
  },
]

export default function TwoAudienceHero() {
  return (
    <section className="border-b border-line bg-canvas py-section">
      <Container>
        <div className="mx-auto max-w-2xl text-center">
          <h2 className="display-type text-3xl leading-tight font-semibold text-ink-strong sm:text-4xl">
            Where would you like to start?
          </h2>
          <p className="mx-auto mt-4 max-w-lg text-md text-ink-muted">
            Foundry is used by two people who want different things from it on day one.
          </p>
        </div>

        <div className="mt-12 grid gap-4 md:grid-cols-2">
          {paths.map((path) => {
            const Icon = path.icon
            return (
              <Link
                key={path.href}
                href={path.href}
                className="group flex flex-col rounded-xl border border-line bg-surface p-6 transition-[border-color,box-shadow] duration-150 hover:border-accent hover:shadow-md sm:p-8"
              >
                <span className="flex size-10 items-center justify-center rounded-lg bg-accent-soft text-accent-soft-ink">
                  <Icon className="size-5" aria-hidden="true" />
                </span>
                <p className="label-caps mt-5 text-ink-subtle">{path.audience}</p>
                <h3 className="display-type mt-2 text-xl font-semibold text-ink-strong">
                  {path.title}
                </h3>
                <p className="mt-3 flex-1 text-sm leading-relaxed text-ink-muted">
                  {path.description}
                </p>
                <span className="mt-6 inline-flex items-center gap-1.5 text-sm font-semibold text-accent">
                  {path.cta}
                  <ArrowRight
                    className="size-4 transition-transform duration-150 group-hover:translate-x-0.5"
                    aria-hidden="true"
                  />
                </span>
              </Link>
            )
          })}
        </div>
      </Container>
    </section>
  )
}

components/ui/layout.tsx

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

/**
 * Layout primitives
 *
 * Five zero-JavaScript building blocks that account for the majority of
 * structure in the library. They exist so that spacing decisions are made once,
 * against density tokens, instead of being re-typed as ad-hoc utilities in
 * every section.
 */

export interface ContainerProps extends HTMLAttributes<HTMLDivElement> {
  /** `prose` narrows to a comfortable reading measure. */
  size?: 'prose' | 'narrow' | 'default' | 'wide' | 'full'
  as?: ElementType
  /** Removes the responsive horizontal gutter. */
  bleed?: boolean
}

const containerSizes = {
  prose: 'max-w-[var(--layout-prose-max)]',
  narrow: 'max-w-3xl',
  default: 'max-w-[var(--layout-content-max)]',
  wide: 'max-w-[110rem]',
  full: 'max-w-none',
} as const

export function Container({
  size = 'default',
  as: Tag = 'div',
  bleed = false,
  className,
  children,
  ...props
}: ContainerProps) {
  return (
    <Tag
      className={cn(
        'mx-auto w-full',
        containerSizes[size],
        !bleed && 'px-4 sm:px-6 lg:px-8',
        className,
      )}
      {...props}
    >
      {children}
    </Tag>
  )
}

export interface StackProps extends HTMLAttributes<HTMLDivElement> {
  direction?: 'row' | 'column'
  gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
  align?: 'start' | 'center' | 'end' | 'stretch' | 'baseline'
  justify?: 'start' | 'center' | 'end' | 'between' | 'around'
  wrap?: boolean
  as?: ElementType
}

const gapMap = {
  none: 'gap-0',
  xs: 'gap-1',
  sm: 'gap-2',
  md: 'gap-gap',
  lg: 'gap-stack',
  xl: 'gap-8',
} as const

const alignMap = {
  start: 'items-start',
  center: 'items-center',
  end: 'items-end',
  stretch: 'items-stretch',
  baseline: 'items-baseline',
} as const

const justifyMap = {
  start: 'justify-start',
  center: 'justify-center',
  end: 'justify-end',
  between: 'justify-between',
  around: 'justify-around',
} as const

export function Stack({
  direction = 'column',
  gap = 'md',
  align,
  justify,
  wrap = false,
  as: Tag = 'div',
  className,
  children,
  ...props
}: StackProps) {
  return (
    <Tag
      className={cn(
        'flex',
        direction === 'column' ? 'flex-col' : 'flex-row',
        gapMap[gap],
        align && alignMap[align],
        justify && justifyMap[justify],
        wrap && 'flex-wrap',
        className,
      )}
      {...props}
    >
      {children}
    </Tag>
  )
}

export interface GridProps extends HTMLAttributes<HTMLDivElement> {
  /** Column count at the largest breakpoint; smaller breakpoints step down. */
  cols?: 1 | 2 | 3 | 4 | 5 | 6
  gap?: StackProps['gap']
  as?: ElementType
  /** Auto-fit tracks with a minimum width instead of a fixed column count. */
  minItemWidth?: string
}

const colMap = {
  1: 'grid-cols-1',
  2: 'grid-cols-1 sm:grid-cols-2',
  3: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3',
  4: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-4',
  5: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-5',
  6: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-6',
} as const

export function Grid({
  cols = 3,
  gap = 'lg',
  as: Tag = 'div',
  minItemWidth,
  className,
  style,
  children,
  ...props
}: GridProps) {
  return (
    <Tag
      className={cn('grid', minItemWidth ? undefined : colMap[cols], gapMap[gap], className)}
      style={
        minItemWidth
          ? {
              ...style,
              gridTemplateColumns: `repeat(auto-fit, minmax(min(${minItemWidth}, 100%), 1fr))`,
            }
          : style
      }
      {...props}
    >
      {children}
    </Tag>
  )
}

export interface DividerProps extends HTMLAttributes<HTMLDivElement> {
  orientation?: 'horizontal' | 'vertical'
  /** Renders a centred text label interrupting the rule. */
  label?: ReactNode
  weight?: 'subtle' | 'default' | 'strong'
}

const dividerWeight = {
  subtle: 'border-line-subtle',
  default: 'border-line',
  strong: 'border-line-strong',
} as const

export function Divider({
  orientation = 'horizontal',
  label,
  weight = 'default',
  className,
  ...props
}: DividerProps) {
  if (orientation === 'vertical') {
    return (
      <div
        role="separator"
        aria-orientation="vertical"
        className={cn('h-full w-px self-stretch border-l', dividerWeight[weight], className)}
        {...props}
      />
    )
  }

  if (label) {
    return (
      <div className={cn('flex items-center gap-3', className)} {...props}>
        <span className={cn('h-px flex-1 border-t', dividerWeight[weight])} role="separator" />
        <span className="label-caps text-ink-subtle">{label}</span>
        <span className={cn('h-px flex-1 border-t', dividerWeight[weight])} aria-hidden="true" />
      </div>
    )
  }

  return (
    <div
      role="separator"
      className={cn('w-full border-t', dividerWeight[weight], className)}
      {...props}
    />
  )
}

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

Usage

Each path is a full card link with its own promise, rather than one headline trying to speak to both — which usually speaks to neither.

  • Two paths, never three. A third means the positioning is unresolved.
  • Give both cards identical visual weight; ranking them defeats the purpose.

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.

  • Two full-card links
  • Distinct promise per path
  • Equal weight

Accessibility

One focus stop
Each card is a single link, not a nest of them.
Icon decoration
Icons reinforce the label and are hidden from assistive tech.

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.