shadcn.io is not affiliated with official shadcn/ui
Carousel examples · Standard
Product Showcase Carousel for React
A product carousel whose cards show an image, a badge, a star rating, a price and an Add to Cart button.
Featured items, new arrivals, related products: a store needs more than pictures in a slider. This React carousel shows one product card per slide, with a picture, a New, Sale or Popular badge, a star rating with the review count, the price and an Add to Cart button. Use it for a homepage shelf or a related-products row.
Preview
Installation
FAQ
When should I use a product carousel instead of a grid?
For a short, picked set of 5 to 12 items, such as deals or recommendations, where you lead the eye one product at a time. When people need to compare prices or filter, a grid works better.
How do I use my own products?
Replace the products array: each entry has a name, price, rating, reviews and a badge that can be null. Swap the placeholder image src for each product's photo, and keep alt set to the product's name.
How are the stars filled?
Five StarIcons. A star is fill-primary text-primary when its number is at most the rating rounded down, and fill-muted text-muted otherwise, so 4.6 shows four stars. The rating and the review count follow as text, which is what a screen reader reads.
When does the badge show?
When the product's badge is set. It's a Badge with absolute end-4 top-4 in the image's corner, and a null badge renders nothing.
Related
- Standard CarouselA basic carousel of five numbered slides
- Carousel with ThumbnailsA carousel with a row of numbered buttons
- Hero CarouselA hero carousel whose slides show a
- Image CardA listing card with a full-width photo
- Badge with Text (Standard)A default badge with a short label for a
- Button with Text (Standard)The one filled action