Story Cover

The framed title card that opens a long page: kicker, title, one line, the chapter list and actions.

Still Coffee

Three plates

How one cup is made, from the bean to the first sip.

import { ActionLink, StoryCover } from '@brand-studio/ui';
import { pour } from '@/demos/assets';

export default function StoryCoverDemo() {
  return (
    <div style={{ width: '100%', padding: '48px clamp(16px, 6vw, 64px)', background: `url(${pour.src}) center / cover` }}>
      <StoryCover
        kicker="Still Coffee"
        title="Three plates"
        lead="How one cup is made, from the bean to the first sip."
        chapters={[
          { label: 'The bean', href: '#beans', marker: 'I' },
          { label: 'The pour', href: '#pour', marker: 'II' },
          { label: 'The cup', href: '#cup', marker: 'III' },
        ]}
        actions={<><ActionLink href="#beans" shape="pill">Start reading</ActionLink><ActionLink href="#menu" tone="inverse" shape="pill">See the menu</ActionLink></>}
      />
    </div>
  );
}

Installation

pnpm add @brand-studio/ui

Usage

import { StoryCover } from '@brand-studio/ui';
<StoryCover
  kicker="Still Coffee"
  title="Three plates"
  lead="How one cup is made, from the bean to the first sip."
  chapters={[
    { label: 'The bean', href: '#beans', marker: 'I' },
    { label: 'The pour', href: '#pour', marker: 'II' },
  ]}
  actions={<ActionLink href="#beans" shape="pill">Start reading</ActionLink>}
/>

Place it over a picture. The glass behind the words darkens the picture a little; check the contrast on the lightest part of the picture it covers.

Accessibility

  • The title is the page's <h1>. Use one cover per page.
  • The chapter list is an ordered list inside a <nav> named by label, so screen readers can jump to it.
  • Chapter links are at least 36px tall.

API Reference

PropTypeDefault
kicker?React.ReactNode
titleReact.ReactNode
lead?React.ReactNode
chapters?StoryCoverChapter[]
actions?React.ReactNode
label?string'Chapters'
id?string
className?string''

Still, Deskhand and Hollis are fictional brands. The coffee photographs are original generated artwork. @brand-studio/ui is MIT licensed.