Video Gallery
ProNewA channel's supplied videos with playlists, subscribe controls and grid, masonry, list, slider or inline-player layouts. Video files or consumer-owned embed URLs load only when played.
Installation
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
Props
| Prop | Type | Default |
|---|---|---|
| playlists* | GalleryPlaylist[]One list of videos, or several: more than one playlist adds tabs. | — |
| channel | GalleryChannelThe channel shown in the header and under the pop-up player. | — |
| header | "banner" | "minimal" | "none"`banner` is a cover image with the avatar over its edge, `minimal` is a compact strip, `none` hides it. | "banner" |
| layout | "grid" | "masonry" | "list" | "slider" | "playlist"`grid`, `masonry` and `list` page through cards, `slider` is a swipeable row, and `playlist` puts a player beside a scrolling list. Only the playlist plays inline; other layouts open a pop-up player. | "grid" |
| columns | 2 | 3 | 4Most columns the grid and slider grow to on wide containers. | 3 |
| pageSize | numberCards per page in the grid. 0 shows everything. | 6 |
| descriptions | booleanShow the description under each card. | false |
| accent | stringAny CSS colour, used for the subscribe button, play badge and active tab. | — |
| subscribeLabel | string | falseText of the subscribe button. `false` hides it. | "Subscribe" |
| subscribedLabel | stringText of the button once subscribed. | "Subscribed" |
| subscribers | stringCount shown beside the subscribe button. | — |
| defaultSubscribed | booleanWhether the visitor starts out subscribed. | false |
| onSubscribeChange | (subscribed: boolean) => voidCalled when the subscribe button is pressed. Do the real work here. | — |
| onVideoOpen | (video: GalleryVideo) => voidCalled when a video starts in the pop-up or the inline player. | — |
| locale | stringLocale used to write dates and counts. | "en-US" |
| loading | booleanDraws placeholders while the videos are being fetched. | false |
| error | stringShown instead of the videos when fetching them failed. | — |
| onRetry | () => voidAdds a Retry button to the error. | — |
| label | stringAccessible name of the gallery. | — |
| className | string | — |
Accessibility
- Playlists are a tablist: Left and Right move between them, Home and End jump to the ends, and the panel is labelled by the selected tab.
- Each card is one button named Play video plus the title, views and date, with the length spoken as minutes and seconds; the subscribe button is a toggle that reports its state.
- The pop-up is a modal dialog titled with the video: native playback closes with Escape, Close always restores focus to the card, and Previous and Next stay in the dialog. When focus enters an embedded iframe, use Close; its keys belong to that player.
- The slider scrolls natively, so touch, trackpad and Tab all work, with arrow buttons that disable at each end; grid, masonry and list have named page buttons.
- No player is loaded until play is pressed; supplied embeds and page links accept only HTTP(S) or root-relative URLs. Under reduced motion thumbnails do not zoom, the slider jumps instead of gliding and the dialog appears without a fade; otherwise the panel and backdrop enter together.