shadcn.io is not affiliated with official shadcn/ui
Centered Masonry Gallery Hero Block for React
A showcase hero for a design studio: a centered headline with a Shine Button, over a masonry wall of six projects drawn in greyscale inside a hairline frame that fades out at its foot.
Installation
Overview
A centered showcase hero above a masonry wall, for React with Base UI. A status badge, a bold headline, one sentence, a ShineButton and an outline Button, both links, sit over a wall of six tiles in square, landscape and portrait shapes, staggered in columns like a photo wall. The wall sits in a hairline frame with + marks on its top corners, runs on below the first screen and fades out at its foot, taking the frame's side lines with it. Each tile is a small greyscale drawing of a kind of work, made in markup: a brand mark with its palette, two app screens, an editorial page, a box's dieline, a dashboard and a poster. Each keeps its shape, ready for your own images. It's built from Shine Button, Button, Badge, Status, Aspect Ratio and Guides, with Tailwind CSS's multi-column layout, container queries that size each drawing to its tile and a CSS entrance that stays still under reduced motion. Made for portfolios, studios, photography sites and storefronts, where showing the work does the convincing. The copy is for Fieldwork, a made-up studio: replace it with your own.
FAQ
How do I replace the drawings with real images?
Each tile is an AspectRatio holding a drawing (BrandArt, AppArt and the rest, chosen by the shot's id). Replace the drawing with an img that fills the box (absolute inset-0 size-full object-cover), and keep the tile's ratio: the box reserves the image's height before it loads, so nothing jumps. Add an src and an alt to each entry in SHOTS, with an alt that says what the work is. Then remove aria-hidden from the wall: it's there only because the drawings are decoration.
How does the masonry layout work?
It's CSS multi-column layout: columns-2 on phones and columns-3 from the md breakpoint. The tiles flow down the first column and on into the next, and the browser balances the columns' heights. break-inside-avoid keeps a tile from splitting between two columns. There's one list, SHOTS, and no script measures anything. Change a tile's ratio (1, 4 / 3 or 3 / 4) to change its shape; the browser rebalances the columns.
How do the frame and the fade at the foot work?
The frame is a Guides layer with a top rule, two side lines and + marks on the top corners, and fade="bottom" fades the side lines out toward the bottom. The tiles sit in a wrapper with a maximum height (30rem on phones, 42rem from md), overflow-hidden and a mask-image gradient, so the lower tiles are cut and fade into the page instead of ending on a hard edge. Raise the maximum height to show more of the wall, or remove the wrapper's limit to show all six tiles.
Can the tiles link to case studies, and where do the buttons go?
Yes. Wrap each tile in an a to its case study, give its image an alt (the link's name) and a visible focus ring, and remove aria-hidden from the wall. Their Tab order follows the columns: down the first column, then the next. The two calls to action are links to #: point them at your portfolio and your process pages.
On Base UI, each button renders its link with render={<a href="#" />} and nativeButton={false}.
How does the wall adapt to small screens?
On phones the wall keeps two columns instead of collapsing into one, and is cut at 30rem, so the first screen holds the headline and the button and the next shows the first tiles. From the md breakpoint it has three columns. The headline wraps, balanced, at text-4xl, and the two buttons stack, centered. The tiles keep their shapes at every width, since each one's height follows its width.
How does the entrance work, and what happens with reduced motion?
It's CSS. The badge, the headline, the sentence and the buttons fade up in turn through Tailwind's starting: variant (@starting-style), then the tiles rise one after another, 60 ms apart, each with its own transition-delay. With reduced motion there is no transition, so the hero and the wall render at rest at once. The block has no state and runs no script.
Related
- Pro
Bento Grid Feature Showcase Hero
Features and tablesA showcase hero with the headline on one side and the pitch on the other, over a bento of six labelled product views in cells that share hairlines.
- Pro
Split Layout Overlapping Browser Frames Hero
Product windowsA split hero for a design tool: a headline, a Shine Button, a second action and three short feature ticks beside two overlapping browser windows that run off the edge of the column: a projects list behind an editor.
- Pro
Split Layout Image Hero
Product windowsA reverse split hero for an AI code assistant: an editor drawn from UI runs edge to edge to the start rail, with a file tree, code, a ghost suggestion and an assistant panel; a divider and the copy sit at the end.
- Pro
Centered Floating Feature Cards Hero
Stats and live dataA centered hero between solid rails with four small product cards (uptime, a resolved incident, who is on call, latency) drifting in around the copy, a Shine Button, an outline button and a ruled proof band.
- Pro
Split Avatar Grid Hero
Logos and social proofA compact split team hero: a headline, a Shine Button, a second action and a line of team facts beside a two-by-two grid of large avatars with names and roles in cells that share hairlines.
- Pro
Centered Browser Frame Hero
Product windowsA centered showcase hero over a full-width browser window showing the product, a logs explorer with a request histogram and a log, held by a hairline frame and faded below the fold.