Skip to main content
Version: latest
Works everywhere

PostTeaser works in both server and client environments. Always use the standard import (e.g. @prokodo/ui/post-teaser) — the library detects the runtime automatically.

PostTeaser

PostTeaser renders a vertical card-style teaser for blog or news content. Suited for grid-based article listings with a prominent cover image.

Live demo →

Overview

import { PostTeaser } from "@prokodo/ui/post-teaser"
;<PostTeaser
title="Design tokens in practice"
slug="/blog/design-tokens"
date="2024-04-10"
image={{ src: "/blog/tokens.jpg", alt: "Design tokens" }}
category="Design"
excerpt="How we use design tokens across our component library."
/>

Import

import { PostTeaser } from "@prokodo/ui/post-teaser"

CSS:

import "@prokodo/ui/post-teaser.css"

Props

PropTypeDefaultRequiredDescription
titlePostTeaserHeadlineHeadline config: { content: string } & HeadlineProps.
contentstringExcerpt text.
categorystringCategory label.
hideCategorybooleanfalseHide the category chip.
imageImagePropsCover image props.
redirectPostTeaserRedirectLink config: LinkProps & { label?: string; icon?: IconProps }.
datestringISO date string (requires locale when provided).
localeIntl.LocalesArgumentLocale for date formatting (required when date is set).
colorHeadlineVariantAccent color variant.
wordCountnumberWord count for reading-time calculation.
readCountnumberRead count shown in meta.
onClick() => voidClick handler on the teaser card.
structuredDatabooleanfalseEmit JSON-LD structured data.
classNamestringCSS class on root element.

See src/components/post-teaser/PostTeaser.model.ts for the full PostTeaserProps type.


Color

The color prop applies a consistent accent across the teaser card and its interactive elements:

ValueCard border / shadowHeadline textLink icon
"primary"Brand blue (30 % tint border + glow)Brand blueBrand blue
"secondary"Accent cyan (30 % tint border + glow)Accent cyanAccent cyan
"success"Green indicatorGreenGreen
"warning"Amber indicatorAmberAmber
"error"Red indicatorRedRed
"info"Neutral fg tintMutedMuted
"white"Default white card, no shadowinherit (dark auto-contrast)primary fallback
"inherit"No overrideinheritprimary fallback

Design Tokens

PostTeaser 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
--pk-space-lgCard header and footer padding
--pk-color-mutedDate text colour
--pk-color-brandLink hover colour override

AIC Note

Use the standard import path in application code:

import { PostTeaser } from "@prokodo/ui/post-teaser"

No separate /client or /lazy import selection is required in consumer code.

AIC components also support a priority flag for critical above-the-fold elements. This is most visible on Image (native preloading via <link rel="preload"> for above-the-fold content).


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: 2 jest-axe assertion(s) across 4 test file(s) · 3 ARIA attribute occurrence(s) in source scan. Criteria marked 🔍 require manual verification in the final product integration and theme context.

Storybook

👉 Open PostTeaser in Storybook


Source

src/components/post-teaser/PostTeaser.model.ts