Instagram Feed
ProNewA supplied-data Instagram-style profile feed: grid or slider photo tiles and opt-in masonry post cards, with profile stats, Follow and a popup with media, caption and comments.
Installation
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
Props
| Prop | Type | Default |
|---|---|---|
| profile* | InstagramProfile | — |
| posts* | InstagramPost[] | — |
| layout | "grid" | "slider" | "masonry"`grid` wraps square tiles, `slider` pages them, `masonry` adds post details below image cards. | "grid" |
| columns | 3 | 4 | 5 | 6Tiles per row on wide containers. Narrow ones drop to three, two, or one for the slider. | 4 |
| gap | numberSpace between tiles, in pixels. | 4 |
| header | booleanShows the profile header. | true |
| popup | booleanOpens posts in a popup. Off, tiles link straight to Instagram. | true |
| pageSize | numberTiles shown before "Load more" in the grid. | 8 |
| 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. | — |
| onLike | (post: InstagramPost, liked: boolean) => voidCalled when a post is liked or unliked in the popup. | — |
| loading | booleanShows placeholders while you fetch the feed. | — |
| className | string | — |
Accessibility
- Each tile is a button named by the photo's alt text or caption, and likes and comments on hover are also read on keyboard focus.
- The popup is a modal dialog: it traps focus, closes on Escape, returns focus to the tile, and Left and Right arrows move between posts.
- The slider is a focusable scroll region with scroll-snap, so it swipes on touch and scrolls with arrow keys; its buttons disable at each end.
- Follow is a toggle button with `aria-pressed`, or a safe link to the profile when no handler is given; unsafe supplied post/profile targets never become active links.
- The mobile sheet and backdrop enter together; tile entrance, hover zoom, like pop and double-tap heart are dropped under `prefers-reduced-motion`.