# VideoShelf

> A titled row of video cards that scrolls sideways, the shelf a catalogue home stacks: native scroll snap moves it by touch, trackpad and keyboard with no script, and once script runs, paging buttons at its edges step one screenful at a time and disable at either end.

```ts
import { VideoShelf } from "@sdxc/ui/video";
```

Renders the shelf: the heading row, then the scroller holding a list of items, between two
paging buttons kept hidden until the shelf's island reveals them. The scroller is a labelled
region, so a keyboard reaches it and scrolls it with the arrow keys.

## Examples

```tsx
<VideoShelf id="trending" title="Trending now" labels={{ previous: "Previous", next: "Next" }}>
	{titles.map((title) => <VideoShelf.Item><VideoCard {...title} /></VideoShelf.Item>)}
</VideoShelf>
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `id` | `string` | Names the shelf and its parts; the heading and the scroller derive their ids from it. |
| `title` | `RemixNode` | The shelf's heading, such as "Continue watching". |
| `action?` | `RemixNode` | A link beside the heading, such as "See all". |
| `labels` | `Labels` | The paging buttons' names, which script reveals. |
| `size?` | `"landscape" \| "poster"` | Default: `"landscape"`. |
| `level?` | `2 \| 3` | The heading's level. Default: `2`. |
| `children` | `RemixNode` | VideoShelf.Item elements, one per card. |

Also accepts everything in `Omit<TagProps<"section">, "title">`.


### VideoShelf.Item

One card's place in the shelf, snapping to the scroller's start so a step lands on a card's edge rather than through one.

Also accepts everything in `TagProps<"li">`.


## Types

| Name | Values | What it decides |
| --- | --- | --- |
| `Size` | `"landscape" \| "poster"` | Which card shape the shelf holds, which sets how wide each item is. |
