Social Feed
ProNewOne feed for posts from Facebook, X, LinkedIn, Pinterest, TikTok, Tumblr and any other network: a profile header with Follow, post cards with text, media and counts in a grid, masonry, timeline or carousel, and a popup for the full post.
Installation
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
Props
| Prop | Type | Default |
|---|---|---|
| posts* | SocialPost[] | — |
| profile | SocialProfileAdds a header with avatar, name, stats and a Follow button. | — |
| layout | "grid" | "masonry" | "list" | "carousel"`grid` aligns equal cards, `masonry` packs cards of their own height, `list` is one timeline column, `carousel` is a row you swipe or page through. | "grid" |
| columns | 2 | 3 | 4Cards per row on wide containers. Narrow ones drop to two, then one. | 3 |
| filter | booleanShows a filter pill per network. Needs posts from at least two. | true |
| lines | numberLines of text before a card is cut with "Read more". | 4 |
| pageSize | numberCards shown before "Load more". The carousel shows every post. | 6 |
| popup | booleanOpens posts in a popup. Off, cards link straight to the network. | true |
| following | booleanWhether the visitor follows the profile. Leave it out to let the button keep its own state. | — |
| onFollow | (following: boolean) => voidCalled by the Follow button. Without it, the button is a link to the profile. | — |
| loading | booleanShows placeholders while you fetch the feed. | — |
| className | string | — |
Accessibility
- Each post is an `article` with one button named "Post by Slow Roads on Facebook, 2 hours ago"; the network mark has a text name and counts are read as "1.3K likes".
- The popup is a modal dialog titled by the author: it traps focus, closes on Escape, returns focus to the card, and Left and Right arrows move between posts.
- The carousel is a focusable scroll region with scroll-snap, so it swipes on touch; its arrows disable at each end and the page dots are named buttons with `aria-current`.
- Network filters and Follow are toggle buttons with `aria-pressed`; loading announces "Loading posts" while placeholders show.
- Card entrance, media zoom, the sliding filter pill and the dialog animation are dropped under `prefers-reduced-motion`.