Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Square Grid Profile Gallery Block for React

A drawing-sharing profile: an avatar, a bio, posts, followers and following, a Follow toggle that adds one, and Posts, Reels and Saved tabs over a three-column square grid that opens one viewer.

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 square-grid profile for React with Base UI, for Doodlebay, a drawing-sharing app. A split with the profile at the start and, beside a hairline divider, three tabs (Posts, Reels and Saved) over a three-column grid of square drawings on shared hairlines. The profile has a compact header, an initials avatar, a name and handle, a short bio, a list of posts, followers and following, and a Follow toggle that adds one to the follower count and takes it back. Some posts carry a "several pictures" mark, one is pinned, and reels carry a play mark and a length. Every square is a button that opens one viewer dialog: the whole drawing, its title and date, Previous and Next through the tab's own posts, a counter, arrow keys and Escape, and focus goes back to the square last shown. The tabs hold one height, so switching never moves the page. The drawings are pen-and-ink in your theme's own greys, not photographs. Following and the follower count are local to the page: nothing is saved. Reels carry no video; the viewer says so. It's built from Tabs, Toggle, Avatar, Dialog, Button and Guides. The app, the people, the handles and the posts are made up for the example.

FAQ

How do I use my own posts?

Each post in POSTS, REELS and SAVED has a title, a caption, a handle, an ISO date, a count of pictures, a pinned flag, a reel length in clip and a scene. Add your image's address and replace the Scene in the square and in the viewer with an <img> (alt="" in the square, whose button is named; alt set to the caption in the viewer). The comment above Scene says where.

What does the Follow button do?

It is a toggle with an aria-pressed state: it fills with the foreground, swaps its icon for a tick, and adds one to the follower count, which a polite line also announces. Pressing it again takes the follow back. Nothing is sent anywhere; wire the handler to your own follow request.

How does the viewer work?

There is one dialog. A square sets the tab and the position and opens it; Previous, Next, the arrow keys (mirrored in a right-to-left layout), Home, End and a swipe move through that tab's posts, wrapping around. Closing it returns focus to the square of the post last shown. On a phone the viewer fills the screen.

Do the tabs change the page's height?

No. Each tab's grid is also in the page as an unseen set of empty squares, stacked in the same grid cell as the live panels: the tallest sets the height. Posts has nine drawings, so the other two tabs sit on the same height.

Do reels play?

No, and the viewer says so: a reel is a poster with a play mark and a length, with the text "this demo has no video". Put your video in the viewer's stage where the drawing is.

How does it work with a keyboard?

The tabs are arrow-key navigable (Home and End too). Every square is a button, so Tab reaches each one and Enter or Space opens the viewer; its Tab order is the close button, Previous and Next. The marks on a square are decorative; the button's name says "pinned", the picture count and the reel length.

  • 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

    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

    Stories Gallery

    Carousels and slides

    A tray of six round highlights for a day-journal app that opens a full-screen viewer with segmented progress bars, tap zones, Previous and Next, a Pause toggle, auto-advance and focus that returns to the highlight.

  • Pro

    Profile Drawer Team

    Lists and directories

    Eight people of a design agency as rows that each open one side drawer with a quote, a bio and three career figures, with Previous and Next buttons that step through the team without closing the drawer.

  • 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

    A masonry wall of nine drawn interiors in three columns, each in its own framed cell, with a caption and a Save toggle that rise on hover and on focus and a live count of saved pictures.