Skip to main content
Version: latest
Server Component

Headline is best rendered on the server. Use the standard import (e.g. @prokodo/ui/headline) — the library detects the runtime automatically.

Headline

Headline renders a typographic heading (h1h6) with design-token typography applied. Supports visual size overrides that decouple visual appearance from semantic level.

Live demo →

Overview

import { Headline } from "@prokodo/ui/headline"
;<Headline level={1} size="h2" animated>
Welcome to prokodo UI
</Headline>

Import

import { Headline } from "@prokodo/ui/headline"

CSS:

import "@prokodo/ui/headline.css"

Props

PropTypeDefaultRequiredDescription
childrenReactNodeHeadline content.
type"h1" | "h2" | "h3" | "h4" | "h5" | "h6""h2"HTML heading tag rendered.
size"xxl" | "xl" | "lg" | "md" | "sm" | "xs" | numberVisual size preset or numeric scale.
colorHeadlineVariantText color variant.
weight"normal" | "bold" | "light"Font weight override.
align"left" | "center" | "right"Text alignment.
highlightstringSubstring to visually highlight.
schemabooleanfalseEmit JSON-LD schema markup.
animationPropsAnimatedPropsEntrance animation config.
classNamestringCSS class on root element.

See src/components/headline/Headline.model.ts for the full HeadlineProps type.


Design Tokens

Headline does not define component-specific CSS custom properties. Override appearance by customising the following global design-system tokens on :root or a scoped ancestor:

TokenDescription
--pk-color-fgText color for color="inherit"
--pk-color-brandText color for color="primary"
--pk-color-accentText color for color="secondary"
--pk-color-mutedText color for color="info"
--pk-color-successText color for color="success"
--pk-color-warningText color for color="warning"
--pk-color-errorText color for color="error"
--pk-palette-whiteText color for color="white"
--pk-palette-blackText color for color="black"

WCAG 2.2 Status

CriterionNameStatusNote
1.3.1Info and Relationships (A)✅ FulfilledSemantic structure (headings, lists, labels, landmarks) must be conveyed programmatically via HTML or ARIA.
1.3.2Meaningful Sequence (A)🔍 Manual reviewContent reading order in the DOM must match the intended visual presentation order.
1.4.3Contrast (Minimum) (AA)🔍 Manual reviewText must have a contrast ratio of at least 4.5:1 (3:1 for large text). Verify against the final product theme.
2.4.6Headings and Labels (AA)🔍 Manual reviewHeadings and labels must describe the topic or purpose of their associated content.
4.1.2Name, Role, Value (A)✅ FulfilledName, role, and state of all interactive UI components must be programmatically determinable via native HTML semantics or ARIA.

Test coverage: 3 jest-axe assertion(s) across 1 test file(s) · 1 ARIA attribute occurrence(s) in source scan. Criteria marked 🔍 require manual verification in the final product integration and theme context.

Storybook

👉 Open Headline in Storybook


Source

src/components/headline/Headline.model.ts