shadcn.io is not affiliated with official shadcn/ui
Tag Popover Cards Blog Block for React
Three post cells on shared hairlines, each with a drawn wood-grain cover and three tag chips; a post with more tags shows a +3 button that opens a popover of the rest as links with counts.
Installation
Overview
A post card row with tags for React with Base UI, written for Tagwood, a forestry trade magazine. Three cells share their hairlines in one row from rail to rail, one on a phone. Each cell leads with a drawn wood-grain cover bled to its edges (growth rings, flat-sawn grain parting round a knot, quarter-sawn lines with ray flecks), then the post's tags as pill chips, the title as the cell's one link, a dek and a byline. A post shows its first three tags; one with more shows a "+3" button that opens a popover listing the rest as links with the number of posts under each. The chips and the button sit above the cell's link, so each stays its own target. The block ends in the row, and the next section's top rule closes it. It's built from Guides, Badge, Avatar and Popover, with CSS for the entrance and the hover. For trade magazines, documentation blogs and any post list where tags matter but space doesn't allow them all.
FAQ
How do the tags and the +3 work?
Each post lists its tags (a name and a count) in DRAFTS; the first three become chips and the rest go to rest. When a post has more than three, a "+N" button follows the chips, with an accessible name such as "Show 3 more tags". The button opens a popover headed "More tags" with one link per remaining tag and its count. A post with three tags or fewer shows no button.
How does the popover behave?
It opens on click, Enter or Space, closes on Escape or a click elsewhere, and returns focus to the button. The page behind stays usable. It is placed below the button at its start edge with an 8 px offset.
Why are the chips links when the card is one link?
A card is one link, its title, and its target covers the cell. The chips and the "+3" button are raised above it with relative z-10, so a click on a chip goes to the tag, not the post. Chips are links in the page's order, before the title.
How are the covers drawn, and can I use photos?
Each tag family owns one wood-grain pattern, built from path data at the top of the file in two weights of the foreground colour: light at 20% and strong at 60%. Put an img with size-full object-cover in the cover's frame to use a photograph; the frame keeps its aspect ratio and the hairline under it.
Related
- Pro
Cards Grid Blog
Card gridsThe six latest posts of an engineering blog as cards on shared hairlines: drawn greyscale covers, a category, the title as the card's one link, a one-line dek and a byline with the date and reading time.
- Pro
Tag Cloud Blog
Topics and indexesA foraging blog's tag cloud: fourteen tags in five sizes derived from their post counts, each a toggle that lists its three latest posts in a fixed-height panel beside the cloud.
- Pro
Categories Blog
Topics and indexesA houseplant magazine's category index: seven cells on shared hairlines, each a link with an icon ring, a scope, the latest post, a post count and a bar for its share, derived from the list of posts.
- Pro
Filter Chips Blog
Card gridsA coffee journal's archive with a ruled band of category chips and their counts over eight post cells: choosing a chip removes the other posts, a polite line says how many show, and the wall keeps its height.
- Pro
Framed Cards Blog
Card gridsSix text-only posts as raised cards in one tinted frame, two across: category, title as the card's one link, a short dek and a line with author, date and reading time.
- Pro
Search Grid Blog
Card gridsA developer-tools blog behind a search field: a slash shortcut focuses it, typing keeps the posts whose title or summary holds the words and marks them, and six cells draw tiny tool windows as covers.