shadcn.io is not affiliated with official shadcn/ui
Mixed Media Stage Gallery Block for React
One stage that changes its controls with the file: a zoom slider for an image, a storyboard with Play and a scrub slider for a video, a waveform for audio, and page buttons for a document.
Installation
Overview
One stage, four kinds of controls, for React with Base UI, for Postroom, a press-kit host. A split puts a header and a framed stage at the start and, past the divider, a ruled column of six files; on a phone the files are a snap row under the stage. Choose a file and the stage swaps its drawing and its own controls: an image gets a Zoom slider and Reset; a video a storyboard strip, a Play toggle and a scrub slider; an audio clip a waveform with a playhead, Play and a scrub slider; a document Previous, Next and a page count. Nothing plays for real: Play steps through the drawn frames and bars once every second and a half, can be paused, and stops at the end. The stage never changes size. Pictures are drawn, never photographed. It's built from Slider, Toggle, Button and Guides.
FAQ
What are the four kinds of controls?
Image: a Zoom slider (100 to 300 per cent in steps of ten) and Reset, with the picture scaling from its centre. Video: a storyboard of eight drawn frames with the current one ringed, a Play toggle, a Position slider and the time. Audio: a waveform of 48 bars, the ones before the playhead solid, with Play, the Position slider and the time. Document: Previous and Next, disabled at the ends, and "Page 2 of 5".
Does Play really play something?
No. There is no media, only drawings. Play moves the position one step every 1.5 seconds (a bounded interval that starts when you press it, so it also runs under reduced motion), pressing it again pauses, and it stops by itself at the end; pressing Play at the end starts over. Each file remembers its own position when you move to another and back.
How do the sliders work for a keyboard?
Does the stage change size between files?
No. The picture area is always 16:9, the strip row and the controls row always have the same height, and a document is drawn as a page inside the same box. Choosing a file only changes what is drawn and which controls show.
How do I use my own pictures?
The drawn pictures are one Scene component. Where the code comment says so, replace it with an <img> (object-cover in a box of the picture's own ratio) and give each entry a src. Keep each entry's ratio the picture's own so the layout doesn't change. Replace the stage's Drawing and each entry's Scene; a real video or audio element can sit in the same stage box.
Related
- Pro
Media Library Gallery
Filter, sort and tabsA media manager drawn as a window in a hairline frame: tabs that filter by type, a search field, a List or Grid switch, twelve files with size and upload date, and an Empty state.
- Pro
Multi-Select Bulk Actions Gallery
Select and actEight drawn scans on shared hairlines, each with a checkbox, a Select all box that shows a mixed state, Shift to take a run, and a bar with Download, Share and an undoable Delete.
- Pro
Lightbox Gallery
Stage and thumbnailsNine pictures of a photography studio's year on shared hairlines, a featured frame and a caption under each, where every frame opens one viewer dialog with the whole picture, its credit, Previous and Next, a counter, arrow keys and a swipe.
- Pro
Panorama Viewer Gallery
Compare, crop and zoomA drawn alpine valley seven times wider than tall in a framed scroll region you can drag or scroll with the arrow keys, with a minimap that follows the view, a zoom slider from 100% to 300% and a Reset button.
- Pro
Split View Gallery
Stage and thumbnailsAn asset-review split: a listbox of eight files with small drawings at the start, the chosen file's preview and details at the end, and a divider you drag or arrow to resize.
- Pro
Upload Queue Preview Gallery
Select and actA file drop zone that lists every file you pick or drop (name and size, never opened) beside a queue of four seeded files in their states, with Retry, Remove and a Send button.