Editorial masthead
A publication masthead: oversized serif wordmark, issue line, and a scrolling section rail.
Live preview
Source
This exact file renders the preview above.
'use client'
import { useState } from 'react'
import Link from 'next/link'
import { Menu, Search, X } from 'lucide-react'
import { ButtonLink } from '@/components/ui/button'
/**
* Editorial navbar
*
* A masthead: oversized serif wordmark on its own line, section links on a
* rule below. The date line is part of the identity — a publication that does
* not say when it is speaking reads as a brochure.
*
* Section links scroll horizontally on mobile rather than collapsing, because
* for a magazine the sections *are* the navigation.
*/
const sections = [
{ label: 'Systems', href: '/starters/blog/preview/categories/systems' },
{ label: 'Craft', href: '/starters/blog/preview/categories/craft' },
{ label: 'Interviews', href: '/starters/blog/preview/categories/interviews' },
{ label: 'Field notes', href: '/starters/blog/preview/categories/field-notes' },
{ label: 'Archive', href: '/starters/blog/preview/stories' },
]
export default function EditorialNavbar() {
const [open, setOpen] = useState(false)
return (
<div className="w-full border-b border-line bg-surface">
<div className="mx-auto w-full max-w-6xl px-4 sm:px-6">
<div className="flex items-center justify-between gap-4 py-5">
<p className="label-caps hidden text-ink-subtle sm:block">Issue 14 · March 2026</p>
<Link
href="/starters/blog/preview"
className="display-type text-2xl font-semibold tracking-tight text-ink-strong sm:text-3xl"
>
The Quarterly
</Link>
<div className="flex items-center gap-1">
<Link
href="/search"
className="flex size-9 items-center justify-center rounded-md text-ink-muted hover:bg-surface-sunken"
>
<Search className="size-4.5" aria-hidden="true" />
<span className="sr-only">Search the archive</span>
</Link>
<ButtonLink
href="/starters/blog/preview/about"
size="sm"
variant="outline"
className="hidden sm:inline-flex"
>
Subscribe
</ButtonLink>
<button
type="button"
onClick={() => setOpen((value) => !value)}
aria-expanded={open}
aria-controls="editorial-nav-panel"
className="flex size-9 items-center justify-center rounded-md text-ink-muted hover:bg-surface-sunken sm:hidden"
>
{open ? (
<X className="size-5" aria-hidden="true" />
) : (
<Menu className="size-5" aria-hidden="true" />
)}
<span className="sr-only">{open ? 'Close menu' : 'Open menu'}</span>
</button>
</div>
</div>
<nav
aria-label="Sections"
className="hide-scrollbar -mx-4 overflow-x-auto border-t border-line-subtle px-4 sm:mx-0 sm:px-0"
>
<ul className="flex items-center gap-6 py-3 whitespace-nowrap">
{sections.map((section) => (
<li key={section.href}>
<Link
href={section.href}
className="label-caps text-ink-muted transition-colors hover:text-accent"
>
{section.label}
</Link>
</li>
))}
</ul>
</nav>
</div>
<div
id="editorial-nav-panel"
hidden={!open}
className="border-t border-line-subtle sm:hidden"
>
<div className="px-4 py-3">
<ButtonLink href="/starters/blog/preview/about" size="sm" block>
Subscribe
</ButtonLink>
</div>
</div>
</div>
)
}
components/blocks/navigation/editorial.tsx
'use client'
import { useState } from 'react'
import Link from 'next/link'
import { Menu, Search, X } from 'lucide-react'
import { ButtonLink } from '@/components/ui/button'
/**
* Editorial navbar
*
* A masthead: oversized serif wordmark on its own line, section links on a
* rule below. The date line is part of the identity — a publication that does
* not say when it is speaking reads as a brochure.
*
* Section links scroll horizontally on mobile rather than collapsing, because
* for a magazine the sections *are* the navigation.
*/
const sections = [
{ label: 'Systems', href: '/starters/blog/preview/categories/systems' },
{ label: 'Craft', href: '/starters/blog/preview/categories/craft' },
{ label: 'Interviews', href: '/starters/blog/preview/categories/interviews' },
{ label: 'Field notes', href: '/starters/blog/preview/categories/field-notes' },
{ label: 'Archive', href: '/starters/blog/preview/stories' },
]
export default function EditorialNavbar() {
const [open, setOpen] = useState(false)
return (
<div className="w-full border-b border-line bg-surface">
<div className="mx-auto w-full max-w-6xl px-4 sm:px-6">
<div className="flex items-center justify-between gap-4 py-5">
<p className="label-caps hidden text-ink-subtle sm:block">Issue 14 · March 2026</p>
<Link
href="/starters/blog/preview"
className="display-type text-2xl font-semibold tracking-tight text-ink-strong sm:text-3xl"
>
The Quarterly
</Link>
<div className="flex items-center gap-1">
<Link
href="/search"
className="flex size-9 items-center justify-center rounded-md text-ink-muted hover:bg-surface-sunken"
>
<Search className="size-4.5" aria-hidden="true" />
<span className="sr-only">Search the archive</span>
</Link>
<ButtonLink
href="/starters/blog/preview/about"
size="sm"
variant="outline"
className="hidden sm:inline-flex"
>
Subscribe
</ButtonLink>
<button
type="button"
onClick={() => setOpen((value) => !value)}
aria-expanded={open}
aria-controls="editorial-nav-panel"
className="flex size-9 items-center justify-center rounded-md text-ink-muted hover:bg-surface-sunken sm:hidden"
>
{open ? (
<X className="size-5" aria-hidden="true" />
) : (
<Menu className="size-5" aria-hidden="true" />
)}
<span className="sr-only">{open ? 'Close menu' : 'Open menu'}</span>
</button>
</div>
</div>
<nav
aria-label="Sections"
className="hide-scrollbar -mx-4 overflow-x-auto border-t border-line-subtle px-4 sm:mx-0 sm:px-0"
>
<ul className="flex items-center gap-6 py-3 whitespace-nowrap">
{sections.map((section) => (
<li key={section.href}>
<Link
href={section.href}
className="label-caps text-ink-muted transition-colors hover:text-accent"
>
{section.label}
</Link>
</li>
))}
</ul>
</nav>
</div>
<div
id="editorial-nav-panel"
hidden={!open}
className="border-t border-line-subtle sm:hidden"
>
<div className="px-4 py-3">
<ButtonLink href="/starters/blog/preview/about" size="sm" block>
Subscribe
</ButtonLink>
</div>
</div>
</div>
)
}
components/ui/button.tsx
import type { ButtonHTMLAttributes, ReactNode } from 'react'
import Link from 'next/link'
import { cn } from '@/lib/cn'
import { variants } from '@/lib/variants'
import { Spinner } from './spinner'
/**
* Button
*
* The whole action surface of Foundry in one component. It is intentionally a
* *shared* component (no `'use client'`): rendered from a Server Component it
* ships zero JavaScript, and it upgrades to a client island automatically when
* a Client Component imports it.
*
* Height, padding and radius resolve from density and radius tokens, so a
* button restyles itself when the density or palette axis changes. Focus is
* handled once, globally, by the `:focus-visible` rule in `globals.css`.
*/
const buttonVariants = variants(
cn(
'relative inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium',
'transition-colors duration-150 ease-standard select-none',
'disabled:pointer-events-none disabled:opacity-50',
'aria-disabled:pointer-events-none aria-disabled:opacity-50',
),
{
variants: {
variant: {
primary: 'bg-accent text-accent-ink hover:bg-accent-hover active:bg-accent-active',
secondary: 'bg-surface-inverse text-ink-inverse hover:opacity-90 active:opacity-80',
outline: 'border border-line-strong bg-surface text-ink hover:bg-surface-sunken',
ghost: 'text-ink hover:bg-surface-sunken active:bg-surface-sunken',
destructive: 'bg-danger text-white hover:opacity-90 active:opacity-80',
success: 'bg-success text-white hover:opacity-90 active:opacity-80',
warning: 'bg-warning text-white hover:opacity-90 active:opacity-80',
link: 'text-accent underline underline-offset-4 hover:text-accent-hover',
soft: 'bg-accent-soft text-accent-soft-ink border border-accent-line hover:brightness-[0.97]',
},
size: {
sm: 'h-control-sm px-3 text-xs rounded-md',
md: 'h-control px-[var(--density-control-padding-x)] text-sm rounded-md',
lg: 'h-control-lg px-5 text-base rounded-md',
icon: 'h-control w-control p-0 rounded-md',
'icon-sm': 'h-control-sm w-control-sm p-0 rounded-sm',
},
block: { true: 'w-full', false: '' },
},
defaultVariants: { variant: 'primary', size: 'md', block: false },
compound: [
{ variant: 'link', size: 'sm', class: 'h-auto px-0' },
{ variant: 'link', size: 'md', class: 'h-auto px-0' },
{ variant: 'link', size: 'lg', class: 'h-auto px-0' },
],
},
)
export type ButtonVariant =
| 'primary'
| 'secondary'
| 'outline'
| 'ghost'
| 'destructive'
| 'success'
| 'warning'
| 'link'
| 'soft'
export type ButtonSize = 'sm' | 'md' | 'lg' | 'icon' | 'icon-sm'
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
variant?: ButtonVariant
size?: ButtonSize
block?: boolean
/** Swaps content for a spinner while preserving the button's measured width. */
loading?: boolean
/** Announced by assistive tech while `loading` is true. */
loadingLabel?: string
leadingIcon?: ReactNode
trailingIcon?: ReactNode
}
export function Button({
variant = 'primary',
size = 'md',
block = false,
loading = false,
loadingLabel = 'Working',
leadingIcon,
trailingIcon,
className,
children,
disabled,
type = 'button',
...props
}: ButtonProps) {
return (
<button
type={type}
className={buttonVariants({ variant, size, block, className })}
disabled={disabled ?? loading}
aria-busy={loading || undefined}
{...props}
>
{loading ? (
<>
{/* Label stays in the DOM but hidden so the control never collapses
to spinner width halfway through an interaction. */}
<span className="invisible flex items-center gap-2" aria-hidden="true">
{leadingIcon}
{children}
{trailingIcon}
</span>
<span className="absolute inset-0 flex items-center justify-center">
<Spinner size="sm" />
<span className="sr-only">{loadingLabel}</span>
</span>
</>
) : (
<>
{leadingIcon}
{children}
{trailingIcon}
</>
)}
</button>
)
}
export interface ButtonLinkProps {
href: string
variant?: ButtonVariant
size?: ButtonSize
block?: boolean
className?: string
children?: ReactNode
leadingIcon?: ReactNode
trailingIcon?: ReactNode
'aria-label'?: string
'aria-current'?: 'page' | 'step' | 'true' | undefined
target?: string
rel?: string
prefetch?: boolean
}
/** Anchor styled as a button, for when the action is really navigation. */
export function ButtonLink({
href,
variant = 'primary',
size = 'md',
block = false,
className,
children,
leadingIcon,
trailingIcon,
...props
}: ButtonLinkProps) {
return (
<Link href={href} className={buttonVariants({ variant, size, block, className })} {...props}>
{leadingIcon}
{children}
{trailingIcon}
</Link>
)
}
export { buttonVariants }
Demo source — adapt to your project. Foundry is not published as a package.
Usage
For publications. The section rail scrolls horizontally on mobile instead of collapsing, because for a magazine the sections *are* the navigation and hiding them behind a menu buries the product.
- The issue and date line is identity, not decoration — a publication that will not say when it is speaking reads as a brochure.
- Scrolling rails need `hide-scrollbar` plus real overflow, never a fixed width with clipped content.
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.
- Issue line
- Serif wordmark
- Horizontally scrolling sections
Accessibility
- Scroll region
- The rail scrolls with the keyboard because its items are focusable links.
- Heading order
- The wordmark is a link, not a heading, so it does not compete with the page `h1`.
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.
Related
All navigationEditorial colophon
A colophon: what the publication is, who makes it, and how it is set.
starter3 variantsContent starter
A magazine with six article routes, four category indexes and four author pages — twenty-one routes from six definitions.
intermediate4 variantsEditorial page
A publication front page moving from lead article to progressively denser indexes.
starter4 variants