shadcn.io is not affiliated with official shadcn/ui
Masonry FAQ Block for React
A masonry FAQ for an aquarium shop: six answer tiles of different heights packed into columns inside a drawn frame, all on show, with one larger featured tile.
Installation
Overview
A masonry FAQ for React with Base UI. A start-aligned title and sentence sit above a frame whose lines run a little past its corners with + marks. Inside it, six answer tiles are packed into three columns on a desktop, two on a tablet and one on a phone, each as tall as its answer, so the columns end unevenly like a stack of cards. The tank-cycling question is the featured tile, with a tint, larger type, a longer answer and a quiet tag. Every answer is on show, so nothing opens. The page's rails and top rule come from the Guides spine, so the block lines up with its neighbours in a stack. It's built from Badge and Guides, with CSS columns for the layout, CSS transitions for the entrance and your theme's tokens for every colour. For shops and product pages with a mixed bag of questions of very different lengths.
FAQ
How do I change the questions?
Edit TILES at the top of the file: each entry is an id, the question and its answer, with featured: true on the one that should stand out. Keep one featured tile, first in the list: it opens the first column. Six tiles pack well into three columns, two to a column; the columns balance themselves, so any count from six to nine works.
In what order are the tiles read?
CSS columns fill the first column from top to bottom, then the second, then the third, and the markup follows the same order, so a screen reader reads the questions in the order the eye does. A reader skimming across the top row sees the first tile of each column, not the first three questions.
How is it read by a screen reader?
The tiles are a list of articles, and each question is an h3 under the section's h2, so the headings list shows all six. There are no controls, so Tab passes straight through.
Does it follow my theme?
Yes. The tiles are card-coloured with a faint foreground ring, the featured tile takes a muted tint and a stronger ring, and the frame's lines are your border colour, so it is light on a light page and dark on a dark one, in every preset.
Related
- Pro
Card Grid FAQ
Cards and gridsA static FAQ grid for a seed shop: six questions with their answers on show, in cells that share hairlines, each with an icon tile and a topic tag.
- Pro
Expandable Cards FAQ
Cards and gridsAn FAQ of six separate cards for a candle subscription, each a collapsible with a topic tag and a round plus that fills in and becomes a minus; the open card lifts.
- Pro
Minimal FAQ
Cards and gridsA type-forward FAQ for a stationery brand: six questions in large type with their answers on show in a definition list, no cards or row lines, and one contact link.
- Pro
Dual Column Accordion FAQ
Accordion listsA two-column FAQ for a pottery studio: a start-aligned header, then two independent accordions of four questions side by side, behind a split divider.
- Pro
Bento Grid Features
BentosA bento of five features for an issue tracker, each cell drawn as the product at work: a live board with teammates' cursors, a pull request, a burndown, a triage rule and a typed SDK, in cells that share their hairlines.
- Pro
Mega Help Index FAQ
Cards and gridsA help-index FAQ for a DIY store: sixteen questions in four topic columns on shared hairlines, with the chosen answer in a framed reading panel above them.