shadcn.io is not affiliated with official shadcn/ui
Product Showcase Gallery Block for React
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.
Installation
Overview
A product showcase for React with Base UI. A vertical rail of four thumbnails (side, top, sole and detail) sits beside a 4:3 stage that shows the chosen angle; they are vertical tabs, so the arrow keys move through the angles and the stage is the panel. At the end of the split, the product: its name and a sentence, a group of three finishes (Graphite, Stone, Bone) that steps the shoe's upper through the theme's greys in every picture, price, sizes and stock in a definition list (the stock line follows the finish), and the Shine Button, "Add to bag". On a phone the thumbnails become a row under the stage. The shoe is drawn in the theme's greys, never photographed. The page's rails and top rules come from the Guides spine. It's built from Guides, Tabs, Toggle Group and Shine Button, with CSS transitions for the entrance. For shops, product pages and any item worth seeing from more than one side.
FAQ
How do I add another angle?
Add an entry to VIEWS (an id, a label, a description and a scene kind) and write the picture: each kind is a small function in the scene kit, and with photographs you replace Scene with an <img> per view. The rail takes any number of thumbnails; on a phone it scrolls sideways when they don't fit.
How do the finishes work?
The finish's index is the drawing's seed, and the shoe's upper picks one of the kit's inks from it: dark for Graphite, middle for Stone, light for Bone. Every thumbnail and the stage redraw at once. With photographs you would keep one image per finish and angle, and swap them in sceneOf's place. The group always keeps one finish chosen, and the stock line and the label above it follow.
Which keys work?
Tab goes to the rail, and the up and down arrow keys move through the angles (the rail is a vertical tab list, so left and right do nothing, even on a phone where the thumbnails sit in a row). Arrowing moves focus; press Enter or Space to choose the angle. The finishes are a toggle group of their own, with one finish always on, and a polite line announces the angle and finish.
What does Add to bag do?
It is a Shine Button that marks this finish as added (the label changes to "Added to your bag" and a polite line says so) and does nothing else: connect it to your cart in addToBag. Choosing another finish brings the original label back, because it's a different product.
Related
- Pro
Thumbnail Strip Gallery
Stage and thumbnailsA viewer for a lighting shop: a framed 4:3 stage with Previous and Next, its caption beside it, and a scrollable strip of twelve thumbnails whose arrow keys step through the pictures.
- Pro
Featured Hero Gallery
Masonry and mosaicA 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
Spotlight Ring Gallery
Carousels and slidesA watch reseller's gallery: eight round dials stand in a ring around one large dial, and choosing a dial, by pointer or with the arrow keys that turn round the ring, brings it to the centre.
- Pro
3D Prism Carousel Gallery
Carousels and slidesOne stacking chair drawn from four sides on the faces of a block that turns a quarter at a time in CSS 3D, with a View control for front, side, back and top, flat under reduced motion.
- Pro
Variant Matrix Gallery
Design assetsA native table of drawn mugs by glaze and size, where hovering or focusing a cell lights its row and column heads and the cells between them, and choosing a cell writes its stock in a status line that keeps its height.
- Pro
Tabbed Product Views Hero
Interactive demosA centred showcase hero with a Shine Button and an outline action over a pill tab switch and one wide product window in a hairline frame that shows a chat, a terminal session or a docs page.