ComponentsSite blocks

News ticker

A “Trending now” or breaking-news strip. rotate shows one headline at a time with previous / next and a pause button; it pauses while hovered or focused and when the tab is hidden, and never starts under prefers-reduced-motion (WCAG 2.2.2). Headlines are announced only while it is paused, so it never chatters. marquee is a continuous crawl on the kit Marquee (CSS, pausable, static with reduced motion).

Marquee blocks/site/news-ticker.tsx, styles/blocks.csstheme · material · accent · density · font

Installation

$ pnpm add @vamos-ui/react

The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";

Usage

import { NewsTicker } from "@vamos-ui/react/blocks";

<NewsTicker items={[{ title: "Swing bridge closes tonight", href: "/city/bridge", category: "Traffic", breaking: true }, …]} />
<NewsTicker mode="marquee" tone="ink" items={headlines} />

Under 28rem the category label and the previous arrow hide; pause and next stay.

Examples

API

NewsTicker

PropTypeDefault
items
breaking adds a dot (pulses only without reduced motion).
{ title; href; category?; breaking? }[]—
mode
One at a time, or a crawl.
"rotate" | "marquee""rotate"
interval
rotate: ms per headline.
number5000
autoplay
rotate: advance on its own (never under reduced motion).
booleantrue
label
The tag; names the region.
ReactNode"Trending now"
tone
Tag colour.
"accent" | "ink" | "danger""accent"
locale / labels / components / className
Strings: trendingNow, pause/play, previous/next headline.
…—