#242
Gallery with video, caption and download
A lightbox gallery with three items, two images and one video, each with a caption and some with meta text.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Gallery with video, caption and download" pattern (@codeatlasdev/ui demo #242, feedback/lightbox) in my app.
Call get_demo({ ids: ["#242"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Browsing attachments or media in a thread, with captions and authors, using next and previous navigation.
Keep these library parts, with the props and tokens the demo uses:
- Button, Lightbox, LightboxItem from "@codeatlasdev/ui"
Behaviour to keep:
- `<Lightbox bind:open bind:index {items} />` with `items: LightboxItem[]`
- Three items: image Moodboard, v1, video `type: 'video'` Short clip with a `poster`, image Moodboard, v2
- Fields used: `src`, `alt`, `caption`, `meta`; the third item has no `meta`
- Trigger resets `index = 0; open = true;` and is labelled `Open gallery ({items.length})`
Reduced motion: the demo handles it; keep that branch.
Keyboard: operable; keep the focus order and key handling.
Change only the copy and the data. Use the theme tokens (--ca-*), never raw colours. Library parts
How it is built
- `<Lightbox bind:open bind:index {items} />` with `items: LightboxItem[]`
- Three items: image Moodboard, v1, video `type: 'video'` Short clip with a `poster`, image Moodboard, v2
- Fields used: `src`, `alt`, `caption`, `meta`; the third item has no `meta`
- Trigger resets `index = 0; open = true;` and is labelled `Open gallery ({items.length})`
Related
Loading source.