Skip to main content
Version: latest
Works everywhere

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

PostWidgetCarousel

PostWidgetCarousel renders a horizontally scrollable strip of post cards — the carousel variant of PostWidget. Suitable for "more articles" sections between page content.

Live demo →

Overview

import { PostWidgetCarousel } from "@prokodo/ui/post-widget-carousel"
;<PostWidgetCarousel title="You might also like" posts={relatedPosts} />

Import

import { PostWidgetCarousel } from "@prokodo/ui/post-widget-carousel"

CSS:

import "@prokodo/ui/post-widget-carousel.css"

Props

PropTypeDefaultRequiredDescription
itemsPostWidgetCarouselItem[]Array of carousel items.
titlePostWidgetCarouselHeadlineSection heading: { content: string } & HeadlineProps.
autoplaynumberAutoplay interval in ms (0 or undefined disables autoplay).
colorVariantsAccent color (extends CardProps).
structuredDatabooleanfalseEmit JSON-LD structured data.
classNamestringCSS class on root element.

See src/components/post-widget-carousel/PostWidgetCarousel.model.ts for the full PostWidgetCarouselProps type.


Color

The color prop propagates a shared accent through every visual layer of the carousel:

ValueCard border / shadowTitle headlineItem headlinesNav buttons
"primary"Brand blue (30 % tint border + glow)Brand blueBrand bluePrimary
"secondary"Accent cyan (30 % tint border + glow)Accent cyanAccent cyanSecondary
"success"Green indicatorGreenGreenSuccess
"warning"Amber indicatorAmberAmberWarning
"error"Red indicatorRedRedError
"info"Neutral fg tintMutedMutedInfo
"white"Default white card, no shadowinherit (dark auto-contrast)inheritPrimary fallback

When no color is passed, headlines fall back to "inherit" and nav buttons default to "primary".


Design Tokens

PostWidgetCarousel 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-smNavigation button row gap
--pk-space-mdNavigation button row bottom offset
--pk-space-lgCarousel wrapper bottom padding
--pk-space-xlTop margin for the carousel area
--pk-radius-mdSlide image corner radius

AIC Note

Use the standard import path in application code:

import { PostWidgetCarousel } from "@prokodo/ui/post-widget-carousel"

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.
2.1.1Keyboard (A)🔍 Manual reviewAll functionality must be operable via keyboard alone, without requiring specific timing.
2.2.2Pause, Stop, Hide (A)🔍 Manual reviewAnimations or auto-rotating content lasting more than 5 s must provide a pause/stop control.
2.4.3Focus Order (A)🔍 Manual reviewThe keyboard focus sequence must preserve meaning and operability in the complete page integration context.
2.4.7Focus Visible (AA)🔍 Manual reviewA visible keyboard focus indicator must be present on every interactive element. Verify against the applied product theme.
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: 1 jest-axe assertion(s) across 4 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 PostWidgetCarousel in Storybook


Source

src/components/post-widget-carousel/PostWidgetCarousel.model.ts