Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Vertical Carousel Gallery Block for React

A weaving studio's day in four pictures stacked in a framed viewer and turned up and down, beside a chapter index that marks the chapter on show and goes to any of them.

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 vertical carousel for React with Base UI, for Loomhall, a weaving studio's journal. Four pictures of a day at the studio (dyeing, warping, weaving, finishing) stack top to bottom in a framed viewer at the end of a split, with Up and Down buttons and a "Chapter 2 of 4" line under it. A chapter index at the start lists the four with their time of day and one sentence each, marks the chapter on show, and each row goes straight to its picture. On a phone the viewer comes first, and the index gives way to the line under it. The pictures are drawn: a drying rack of dyed hanks, a loom with its warp, a close-up of weaving and a folded throw, in your theme's greys, light in a light theme and low-key in a dark one. It's built from Carousel, Button and Guides. The studio and its hours are made up for the example.

FAQ

How do I use my own photographs?

Each chapter in CHAPTERS has a title, a time, a summary and a scene. Replace the Scene in the slide with <img alt="" className="size-full object-cover" src={…} /> (the caption on the picture names it). The viewer is 4 wide for 5 high; change RATIO and the aspect-4/5 class together.

How does it work with a keyboard?

Tab reaches the Up and Down buttons and the chapter rows. On either button, the Up and Down arrow keys turn the viewer; on a chapter row, they move to the previous or next chapter and focus follows, so the index works like a vertical list. Enter or Space on a row goes to its picture. Down on the last chapter goes to the first, and Up on the first goes to the last.

How does the index know which chapter is showing?

The block keeps one page number. The viewer, the "Chapter 2 of 4" line (a polite live region) and the index all read it, and the row for that chapter carries aria-current and a bar at its start edge. The block keeps Embla's API and follows its select event, so a drag on the viewer updates the index too.

What happens to the index on a phone?

It is hidden below lg, where the viewer already has the controls, and the line under the viewer names the chapter. The viewer stays 4 wide for 5 high but narrower, so the picture is never cropped.

Does anything move by itself?

No. The carousel only moves when you press a button, a row or an arrow key, or drag it.

Does it follow my theme?

Yes. The pictures mix your theme's tokens, and the divider and marks are the same hairlines as the rest of the page. The block ends on its last row with no closing line.

  • Pro

    Carousel Gallery

    Carousels and slides

    Nine drawn trail pictures in a ruled band for a trail-guide app, three wide with the next one cut off at the rail, turned with buttons, dots and the arrow keys, under a heading row with a live counter.

  • Pro

    Full-Width Slider Gallery

    Carousels and slides

    Five architecture projects as 21:9 slides from rail to rail with a masked caption, a numbered thumbnail rail as the navigation, loop and autoplay with a visible Pause that never runs under reduced motion.

  • Pro

    3D Prism Carousel Gallery

    Carousels and slides

    One 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

    Thumbnail Strip Gallery

    Stage and thumbnails

    A 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

    Carousel Slider Features

    Carousels and media

    A one-slide-at-a-time carousel of the five steps of making a deck, each a checklist beside a greyscale drawing, with a segmented progress bar of labelled segments as the navigation.

  • Pro

    Values Slider About

    Culture and values

    A carousel of six values for an HR platform, one per slide in a band from rail to rail: the value, a practice example and one figure side by side, with Previous and Next buttons, a counter and dots.