#253
Mixed media
A media grid of six items (images, a video, a document) showing four tiles and a +2 overflow that opens the gallery.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Mixed media" pattern (@codeatlasdev/ui demo #253, display/media-grid) in my app.
Call get_demo({ ids: ["#253"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Chat messages with several attachments: thumbnails that open a lightbox, with documents as download links.
Keep these library parts, with the props and tokens the demo uses:
- MediaGrid, MediaGridItem from "@codeatlasdev/ui"
Behaviour to keep:
- `<MediaGrid {items} maxVisible={4} />`
- `{ type: 'video', src: '', thumb: art(130, '▶'), alt: 'Clip', duration: '0:12' }`
- `{ type: 'document', src: '#', title: 'invoice-0412.pdf', size: '84 KB' }`
- `const art = (hue: number, label: string)` builds inline SVG images
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
- MediaGrid
@codeatlasdev/ui
How it is built
- `<MediaGrid {items} maxVisible={4} />`
- `{ type: 'video', src: '', thumb: art(130, '▶'), alt: 'Clip', duration: '0:12' }`
- `{ type: 'document', src: '#', title: 'invoice-0412.pdf', size: '84 KB' }`
- `const art = (hue: number, label: string)` builds inline SVG images
Related
Loading source.