Skip to main content
Version: latest
Server Component

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

Teaser

Teaser is the primary marketing card component. It combines an image, category label, headline, body copy, and a call-to-action link into a single, composable unit. Used extensively in landing pages and section grids.

Live demo →

Overview

import { Teaser } from "@prokodo/ui/teaser"
;<Teaser
headline="Build faster with prokodo UI"
body="A fully typed component library built for Next.js App Router."
image={{ src: "/teaser.jpg", alt: "prokodo UI" }}
cta={{ label: "Get started", href: "/docs/intro" }}
category="Library"
/>

Import

import { Teaser } from "@prokodo/ui/teaser"

CSS:

import "@prokodo/ui/teaser.css"

Props

PropTypeDefaultRequiredDescription
titleTeaserHeadlineHeadline config: { content: string } & HeadlineProps.
contentstringBody copy text.
imageImagePropsTeaser image props.
colorTeaserVariantAccent color variant.
align"left" | "center" | "right""left"Text alignment.
lineClampbooleanfalseClamp body text to a fixed number of lines.
animationstringAnimation name/class override.
redirectTeaserRedirectLink config: LinkProps & { label?: string; icon?: IconProps }.
onClick() => voidClick handler on the teaser.
classNamestringCSS class on root element.

See src/components/teaser/Teaser.model.ts for the full TeaserProps type.


Design Tokens

Teaser 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-space-xsLink icon right margin
--pk-space-smImage caption padding and offset
--pk-space-lgCard content padding

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)🔍 Manual reviewName, role, and state of all interactive UI components must be programmatically determinable via native HTML semantics or ARIA.

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

Storybook

👉 Open Teaser in Storybook


Source

src/components/teaser/Teaser.model.ts