Skip to main content

Design system components

StoryBlock

Narrative section for Work case studies with a subtitle and title, rich text, and images arranged by a selectable layout.

Status: stable. Group: structure. Markdown version: /design-system/components/story-block.md

When to use

StoryBlock is the workhorse narrative section of Work case studies: a subtitle/title pair, rich text content, and images arranged by imageLayout, over background and spacing knobs. Chain several StoryBlocks (with GridBlock mosaics and ProcessBlock) to build a project page's spine.

When not to use

The contract records no forbidden uses.

Look-alikes

The contract names no look-alike with a deciding condition.

Props

StoryBlock props
PropTypeDefaultDescriptionRequired
subtitlestringnoneOptional subtitle/category label.No
titlestringnoneMain title of the story section.Yes
contentReact.ReactNode[]noneBody content as array of paragraphs or React nodes.Yes
imagesStoryImage | StoryImage[]noneImage or images to display. Without imageLayout they render as single (one image) or grid (several); imageLayout="none" hides them.No
imageLayout"single" | "none" | "grid"noneImage layout: "single" (1 col), "grid" (2 col when there is more than one image) or "none" (images hidden). When omitted, passed images render as "single" for one image and "grid" for several.No
backgroundColor"transparent" | "light" | "white"transparentBackground color variant; defaults to transparent. It colours the root element and never changes which element that is.No
maxWidth"sm" | "md" | "lg" | "full" | "xl"mdMaximum width constraint; defaults to md.No
spacing"compact" | "default" | "comfortable" | "spacious"comfortableSpacing variant; defaults to comfortable.No
classNamestring""Additional CSS class.No
as"article" | "div" | "section"sectionRoot element, also when a background color is set. The inner PageLayout wrapper is always a <div>, so sections never nest. Defaults to "section".No
ariaLabelstringnoneAccessible label for the section or article (defaults to the title). Not applied when as="div", since a generic element cannot be named.No
headingLevel2 | 3 | 42Heading level for the section title; visual size is unchanged. Defaults to 2 (a section directly under the page h1); pass 3 or 4 when the block sits under a deeper heading.No

Variants

  • Allowed imageLayout values: single, none, grid.
  • Allowed backgroundColor values: transparent, light, white (default transparent).
  • Allowed maxWidth values: sm, md, lg, full, xl (default md).
  • Available spacings: compact, default, comfortable, spacious (default comfortable).
  • Allowed as values: article, div, section (default section).
  • Allowed headingLevel values: 2, 3, 4 (default 2).

Invalid combinations

The contract records no invalid combinations.

Keyboard

The contract records no keyboard interaction.

Rules

Every item under When not to use is a MUST NOT. MUST and SHOULD follow RFC 2119.

StoryBlock rules
LevelRuleHow it is checked
MUSTARIA: The wrapper is named by ariaLabel, falling back to title, so every StoryBlock rendered as a section is a region landmark; a page with many StoryBlocks gets many landmarks. With as="div" no aria-label is set, since a generic element cannot be named.Not yet verified: no evidence record. WCAG 4.1.2.
MUSTARIA: The root is always the as element (default section), whatever the background; the inner PageLayout wrapper is a div, so sections never nest.Not yet verified: no evidence record. WCAG 4.1.2.
MUSTARIA: Subtitle is a Text kicker, not a heading; the title's heading level comes from headingLevel (default 2)Not yet verified: no evidence record. WCAG 4.1.2.
MUSTRequired stories produce no axe violations at the configured severity.Automated by npm run test:stories:matrix:ci. WCAG 2.5.8.
MUSTThe accessibility tree (role, name, state) matches the committed snapshot for every required story.Automated by npm run test:stories:matrix:ci. WCAG 1.3.1, 4.1.2.
MUSTThe component remains legible and operable under a real browser forced-colors: active pass.Automated by npm run test:stories:hc.
MUSTA human completed an end-to-end accessibility review of this component.Manual review, last on 2026-11-04.
MUST NOTMaintainers: Do not bypass design tokens or skip forced-colors verification at beta.Release review; not machine-checked.

Install and import

  • In-repo only. StoryBlock is not exported from @digitaltableteur/react, so there is no public import path.