Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Expandable Tile Grid Gallery Block for React

Twelve drawn potted plants on shared hairlines where choosing one grows its tile to two cells wide and two tall while the others flow around it, one open at a time, with Escape or a button to put it back and a grid that never changes height.

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

A grow-in-place grid for React with Base UI. A start-aligned header sits over twelve drawn potted plants (a snake plant, a cactus, a fern, a rubber plant, a succulent, a trailing plant, in different pots) on shared hairlines that run rail to rail: four across from sm, three on a phone. Choose a plant and its tile grows to two cells wide and two tall, showing its light, water and height, while the others flow around it with grid-auto-flow: dense. One plant is open at a time, and choosing it again, the Put it back button or Escape returns it. A legend cell fills the last row while every plant is small and shrinks to a one-cell button beside the open tile, so the grid fills the same rows either way and the page never moves. The plants are drawn in the theme's greys. It's built from Guides, Button and Kbd. For catalogues, menus and any set where one item at a time deserves room.

FAQ

How does the grid keep its height?

Twelve plants plus a legend cell fill four rows of four (five rows of three on a phone). Open, the big plant takes four cells, so three plants' worth of room has to come from somewhere: the legend gives up all but one cell on desktop, or all of it on a phone, and the grid still fills the same rows. The open tile is placed by its own position in reading order, pushed in so a two-by-two always fits.

Does the reading order change?

No. The DOM order never changes, only the grid placement, so a screen reader and the Tab order follow the same list. Each plant is a button with aria-pressed, and a polite line says which plant is open.

Which keys work?

Tab visits the plants, Enter or Space grows or restores one, and Escape restores the open one while focus is inside the block. Put it back is a normal button.

How do I use my own photographs?

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 photograph's own so the layout doesn't change.

Are these real prices?

No. The names, prices and care notes are example data typed in each entry.

How does it fit on a phone?

Three columns by five rows of portrait tiles, with names under the pictures. The open plant takes two columns and two rows; the legend is hidden while it is open, so the grid is still fifteen cells.

  • Pro

    Re-lead Mosaic Gallery

    Masonry and mosaic

    A dense mosaic of nine drawn quilt patterns on shared hairlines, eight squares and one lead two cells wide and two tall, with a Lead control that moves the big square while the rest reflow.

  • Pro

    Sixteen drawn thumbnails on shared hairlines, eight across, where choosing one opens a preview band straight under its row with the whole picture, its source, Previous, Next and Close, without changing the block's height.

  • Pro

    Featured Hero Gallery

    Masonry and mosaic

    A boat-charter gallery on one hairline grid: a featured picture two cells wide and tall beside four small ones, and choosing a small picture swaps it with the featured one in place.

  • Pro

    Sortable Masonry Gallery

    Masonry and mosaic

    A masonry wall of twelve drawn pictures of mixed ratio in CSS columns, framed with + marks on its corners, with an Order control (Newest or Oldest) that re-sorts them.

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

  • Pro

    Card Stack Gallery

    Walls and tables

    A pile of five drawn risograph prints on a framed table top: send the top one to the back, or spread the pile into a row and gather it again, with a list that says the order.