Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Shop the Look Lookbook Gallery Block for React

A drawn styled room with four numbered pins that open popovers with the item, its price and a link, beside the same four items as a real list, with two looks to choose from.

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 shop-the-look lookbook for React with Base UI, for Hearth & Hue, a furniture shop. On a wide screen it is a split: the styled room is framed at the start, with + marks on its corners and four numbered pins on it, and at the end of a solid divider sit the header, a "Look" chooser (Reading corner or Morning light) and the same four items as a real list with prices and links. A pin is a real button that opens a popover with the item, its price and a "View" link, from the keyboard or by touch; the list does the same job without any pin, so the pins are decoration on top of it. The pins sit where the drawn sofa, lamp, print and rug are, worked out from the same numbers that draw the room. On a phone the list sits under the room and the pins stay. The room is drawn, not photographed, in your theme's own greys. It's built from Popover, Toggle Group, Button and Guides, with CSS transitions and your theme's tokens for every colour. The shop, its products and its prices are made up for the example.

FAQ

How do I use my own photograph?

Each look in LOOKS has a scene, a caption and four items; every item has a name, a price, a detail, a side for its popover and a position in percent (x, y). Replace <Scene ratio={RATIO} scene={current.scene} /> with <img alt="" className="size-full object-cover" src={…} />, set RATIO to the photograph's width over its height, and type each pin's x and y by hand instead of reading them from anchorsOf, which only knows the drawn room.

Where do the pins come from?

anchorsOf(scene) reads the numbers that draw the room (where the window light falls, which side the sofa is on, how wide it is) and returns a point on the sofa, one on the lamp shade, one on the print and one on the rug, in percent of the picture. A pin is placed at its point with CSS variables, so it stays on its object at every size.

How does it work with a keyboard?

Tab reaches the look chooser (arrow keys move through it), then each pin; Enter or Space opens its popover, Escape closes it and a press anywhere else closes it too. The popover has a "View" link. The list of items under or beside the picture has a real link in every row, so nothing needs a pin. Hovering or focusing a row's link rings the matching pin.

How does it fit on a phone?

The picture comes first, then the chooser's look and the list under it; the pins stay on the picture and open the same popovers, which move to stay on screen. The two looks' lists share one cell, so choosing the other look never changes the height.

What happens with reduced motion?

The popovers open without animation and the looks swap with no fade.

Does it follow my theme?

Yes. The pins are your card and foreground colours, the popover is your popover surface, and the room is mixed from your foreground, background and muted tokens, so the look reads in a light theme and a dark one.

  • 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

    Product Showcase Gallery

    Stage and thumbnails

    A product viewer for a running shoe: a vertical rail of four angles beside a 4:3 stage, three finishes that recolour every picture, and price, sizes and stock with an Add to bag button.

  • Pro

    Four unit layouts drawn to one scale on a metre grid, picked from a toggle group, with a Furnished switch, numbered rooms and a room table whose rows ring their room in the plan.

  • Pro

    A shipping-ops console drawn in greyscale with six numbered pins that open a popover on click, tap or Enter, and a legend of six rows in shared hairlines that opens the same popovers.

  • Pro

    Mood Board Gallery

    Walls and tables

    A pinboard of twelve pieces of five kinds (pictures, paint chips, materials, words and type) pinned a degree off square, with a lens that dims the other kinds without moving anything.

  • Pro

    A listing gallery for a townhouse: a stage that goes room by room, a Day and Dusk switch that lights every window and lamp, and the listing's price, floor area and a Book a viewing button.