Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Product Showcase Carousel Block for Solid

Eight drawn homeware pieces with prices and an Add button on a hairline track inside a frame you can set to phone, tablet or desktop width, so the number of pieces in view follows the frame instead of the screen.

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

Preview how a shelf of products behaves at different widths without leaving the page, with this product showcase carousel for Solid with Ark UI. Hollowfield, a homeware shop, shows eight drawn pieces (a mug, a lamp, a stool, a jug, a throw, a vase, a basket and a clock) in a framed track, each cell with the name, the price and an Add Button. A Toggle Group in the header sets the frame to Phone, Tablet or Desktop, and the frame narrows in place; because the cells are sized by container queries on the frame and not by the screen, the frame decides how many fit: one with the next peeking at the edge, two, or four. A caption under it states the frame's measured width and what that shows. The foot band, ruled by Guides, holds the counter, the bag count that Add raises, a dot for each page and Previous and Next buttons. A phone has no control, because the page is already the phone. It's built from Carousel, Toggle Group, Button and Guides, with CSS transitions only. The shop, the pieces and the prices are made up for the example.

FAQ

How do I list my own products?

Edit PIECES. Each has an id, a name, a price in cents and a kind that picks its drawing. Prices go through one formatter, so $28 and $28.50 both read right. For photographs, replace Drawing in the cell with an img (the comment above it says how); the picture area has one fixed height, so the shelf never changes height when the frame does.

How does the frame, and not the screen, decide how many fit?

The frame is a container, and the cells are sized by queries on its width: under 40rem one piece shows at 87% with the next peeking, from 40rem two, from 52rem four. The caption reads the frame's real width, so on a narrow window the Desktop frame honestly shows fewer pieces than on a wide one. The Carousel's slidesPerPage is set from the frame's measured width, and the cell width comes from a CSS variable set by the same container queries.

What does Add do?

In the example it counts: each press raises "Bag" in the foot, which is the block's one live region, so a screen reader hears "Bag: 2" along with the counter. Nothing is stored or sent. Replace the handler with your own add-to-cart call and keep the count in the foot from your cart.

How does it work with a keyboard?

Tab reaches the preview control, then Add on each piece in view, the dots, Previous and Next. With focus on the buttons or dots the arrow keys move the track (mirrored in a right-to-left layout), and Home and End jump to the first and last page. Pieces that are out of view are hidden from the tab order and from screen readers, and Previous and Next stay in the tab order at the ends.

What happens under reduced motion?

The frame changes width at once instead of easing, the track moves without smooth scrolling, and the dots change without a transition.

Why is there no control on a phone?

The page is already a phone-width frame, so the control would have nothing to show. The frame fills the panel and one piece shows with the next peeking.