Block 291 of 297
News Ticker
A slim bar of linked headlines or alerts that roll vertically one at a time, with previous/next and optional rotation.
- Puck key
- NewsTickerBlock
- Export
- newsTickerBlock
- React component
- <NewsTicker />
- Files
- components/puck/news-ticker-block.tsx
- components/puck/news-ticker.client.tsx
- Dependencies
- gsap
- License
- MIT (GSAP has its own license)
About this block
When to use it, how to write for it, and what to change in the code.
What it's for
A slim full-width bar with a label tag, one linked headline at a time and previous and next buttons, with an optional "All news" link at the end. Headlines roll up vertically. Rotation is off unless you turn it on. On phones the link drops below the bar. With reduced motion set, the headlines show as a plain stacked list.
- City or county news and service alerts under the site header
- School closings or weather notices
- Recent press releases on an organization's home page
Writing the content
- Keep each Headline under about 80 characters so it fits on one line; Headlines allows up to 10.
- Date or tag is meant to be short, like "Today" or "Oct 6", and hides when blank.
- Label becomes a heading for the bar, such as "Alerts"; choose its Heading level to fit the page outline.
- The block renders nothing if every headline is empty.
Accessibility
- The bar is a labelled carousel region, and hidden headlines are inert, so keyboard users only reach the one showing.
- Rotation pauses on hover, on focus and in background tabs, has a Pause button, and never runs for reduced-motion visitors (WCAG 2.2.2).
- Previous and next buttons are 44px with accessible names; a live region announces changes when rotation is off.
Customizing the code
- Requires gsap and news-ticker.client.tsx. Timing options come from the interval select (5, 7, 10 seconds).
- The label pill and progress bar use bg-indigo-600; swap the indigo family to match an alert color.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Labeltext
- Heading levelselect
- Headlinesarray
- Link texttext
- Linktext
- Rotate automaticallyradio
- Time per headlineselect