Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Multi-Select Bulk Actions Gallery Block for React

Eight 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.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Select many for React with Base UI, for Scanwick, a document-scanner app. A start-aligned header sits over a band with a "Select all" checkbox, then eight drawn scans (letters, receipts, flyers) on shared hairlines that run from rail to rail: two columns on a phone, four from lg. Each tile carries a checkbox beside its name, and the whole tile is the click target. Hold Shift and tick a second tile to take every scan between it and the last one you touched; Select all turns mixed (a bar, not a tick) while only some are ticked. A bar at the foot, which ends the block, counts what is ticked and offers Download, Share and Delete. Delete leaves a quiet "Removed" cell where each scan was, so the grid keeps its height, and the bar offers Undo. Every action ends with "Nothing is saved in this demo". The scans are drawn in the theme's greys. It's built from Checkbox, Button and Guides.

FAQ

Where do I click to tick a tile?

Anywhere on it. The checkbox's own hit area is stretched over the whole tile (the box is static, so its ::after fills the tile's frame), so the picture and the name both tick it, and the tile gets a ring when it is ticked or holds keyboard focus. The checkbox is still a real checkbox named by the scan's title, with its kind and page count as the description.

How does the Shift range work?

The block remembers the last tile you ticked or cleared. Hold Shift (with a mouse click, or Shift+Space on a focused checkbox) and tick another tile: every tile between the two, in either direction, takes the state of the one you pressed. Tiles that were deleted are skipped. Touch screens have no Shift, so the hint is hidden on phones; tick tiles one by one or use Select all.

How is the mixed state of Select all drawn?

Select all gets indeterminate next to checked, and a few classes on the box swap the tick for a bar, because the Base UI checkbox draws its tick for the mixed state too.Pressing it ticks every remaining scan; pressing it again clears them.

What happens to a deleted scan?

It stays in the grid as a quiet "Removed" cell the size of the tile, with its title, so nothing around it moves and the block keeps its height. Undo delete brings the last batch back, ticked as before. A second delete before you undo replaces what Undo restores.

Is anything saved or sent?

No. Download, Share and Delete only change what the block shows. It all lives in the block's own state and is gone on reload. Each action says "nothing is saved in this demo" in a polite status line; wire the handlers to your own storage or API when you use it.

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. Keep the tile's ratio the picture's own.

How does it fit on a phone?

Two columns by four rows, with the date left out of each caption. The bar sits under the grid with its status line first and its buttons wrapping below, and the status keeps room for two lines so a long message never moves the buttons.

  • Pro

    Lightbox Gallery

    Stage and thumbnails

    Nine 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

    Sort Controls Gallery

    Filter, sort and tabs

    Eight drawn bike frames that each print their date, likes and title, with a Sort by select, a reverse toggle and a Grid or List switch, so the order is checkable by eye.

  • Pro

    Eight drawn design proposals on shared hairlines, each with a status badge and an Approve or Request changes choice that can be cleared, and a running tally with a progress bar.

  • Pro

    A 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.

  • Pro

    Media Library Gallery

    Filter, sort and tabs

    A 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

    A quiet grid of twenty-four drawn concrete-architecture plates, eight to a page on shared hairlines, with a title and year that appear on hover and focus and the catalog pagination in a band that ends the block.