Skip to content

No.306 · Data

Media Inspector

A media grid with no modal. Selecting an asset opens the grid around it: the thumbnail grows into a full-width inspector on the next row, the rest of the grid reflows to make room, and next/previous walk the inspector through the grid in place.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Paper

Build a media browser that replaces grid → modal with grid → selected object → inspection in place. The grid is CSS grid (auto-fill, minmax(8.5rem, 1fr), grid-auto-flow: row dense) of square thumbnails with filenames. Selecting one turns that grid item into the inspector: it spans the full row (grid-column: 1 / -1), and dense packing backfills the row it came from, so the inspector opens directly beneath its neighbours. The rest of the grid reflows around it with a FLIP translate (380ms). The chosen image grows out of its own thumbnail — a FLIP scale from the thumbnail's rect to the stage (420ms) — so the object you picked becomes the object you're inspecting. The inspector row holds a stage at the asset's real aspect ratio (object-fit contain, capped height) and an info column that fades in after the stage lands. The info column has: - an 'n / total' counter with previous, next and close - the filename and a metadata grid: dimensions with a reduced ratio (4032 × 3024 · 4:3), size and type, taken, place, camera, owner - a palette strip - actions (the primary filled, Delete in red) Next and previous move the inspector through the grid in place — the FLIP makes it hop to the next position — rather than swapping content in a fixed box. Keyboard: thumbnails use roving focus with arrow keys that respect the live column count, plus Home/End. Enter opens. Inside the inspector ← → browse and Escape closes, returning focus to the thumbnail. Under 34rem of container width the grid is three tight columns, and the inspector becomes a full-bleed block of the column (image on top, up to 60vh) with swipe left/right on the image. The demo uses procedural landscape artwork (Wahiba Sands, Muttrah, Wadi Shab…) so it needs no network. Paper and Night themes. Selected variant — Paper (paper): Palette for this theme (Paper): --mi-bg #ffffff; --mi-danger #b42318; --mi-ink #1b1a17; --mi-line rgb(27 26 23 / 0.09); --mi-muted #77736b; --mi-well #efece6. Treat these as the root colour tokens, one value per role, and name them to suit your code. Select it with the theme option set to "paper". Keep every dimension, spacing value, state and motion from the brief unchanged, and keep text at 4.5:1 contrast or better on these surfaces. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Click a photo; use ← → or the arrows to walk through the grid; Esc closes. On a phone, swipe the image. Motion: Grid reflow 380ms FLIP; the chosen image scales out of its thumbnail in 420ms; the info column fades in after. Accessibility: Thumbnails are labelled buttons with roving tabindex. The inspector is a labelled region ('name, 3 of 10') that takes focus; the image has alt text; nav buttons are labelled, and Escape returns focus to the thumbnail. Reduced motion removes the reflow and growth, so the inspector simply appears in place. Responsive behavior: Container queries switch to a three-column grid and a stacked, full-bleed inspector under 34rem, with swipe for next and previous. Touch: Swipe left or right on the image. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Click a photo; use ← → or the arrows to walk through the grid; Esc closes. On a phone, swipe the image.
Motion
Grid reflow 380ms FLIP; the chosen image scales out of its thumbnail in 420ms; the info column fades in after.
Accessibility
Thumbnails are labelled buttons with roving tabindex. The inspector is a labelled region ('name, 3 of 10') that takes focus; the image has alt text; nav buttons are labelled, and Escape returns focus to the thumbnail. Reduced motion removes the reflow and growth, so the inspector simply appears in place.
Responsive
Container queries switch to a three-column grid and a stacked, full-bleed inspector under 34rem, with swipe for next and previous.
On touch
Swipe left or right on the image.