RSS Feed
ProNewA news feed with a header and Subscribe link, showing stories with thumbnail, source, title, excerpt and time as a list, a card grid or a one-line ticker.
Installation
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
Props
| Prop | Type | Default |
|---|---|---|
| items* | RssItem[] | — |
| layout | "list" | "cards" | "masonry" | "carousel" | "ticker"`list` stacks rows with a thumbnail, `cards` wraps into columns, `masonry` packs the same cards into columns, `carousel` slides them sideways with arrows and dots, `ticker` scrolls headlines in one line. | "list" |
| title | stringName of the feed, shown in the header and on the ticker's badge. | "Latest stories" |
| description | string | — |
| feedHref | stringAddress of the feed itself. Adds a Subscribe link to the header. | — |
| pageSize | numberItems shown before "Load more" in the list and cards layouts. | 6 |
| lines | numberLines of excerpt before it is cut. | 3 |
| loading | booleanShows placeholders while you fetch the feed. | — |
| error | stringAn error message to show instead of the items. | — |
| onRetry | () => voidCalled by the Retry button next to the error, which is hidden without it. | — |
| duration | numberSeconds the ticker takes for one full loop. Defaults to six seconds per headline. | — |
| newTab | booleanOpens stories in a new tab. | true |
| className | string | — |
Accessibility
- Each story is an `article` whose title is the link; the whole row or card is clickable but is read once, by its headline.
- The ticker pauses on hover and on keyboard focus, has a Pause button, and its repeated copy is hidden from assistive tech and the tab order.
- Under `prefers-reduced-motion` the ticker stops and becomes a strip you scroll yourself; entrance and hover motion are dropped.
- Loading shows placeholders and announces "Loading stories"; an error is announced as an alert with a Retry button.
- Works with no thumbnails or source logos: the publication's initial stands in.