Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Stepped Before and After Gallery Block for React

One drawn room in three layers, bare plaster, mid-job and finished, revealed from the foot of the picture by a slider with three stops, with room tabs and a line on each visit.

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 stepped before-and-after for React with Base UI, for Plasterwork, a renovation studio. Under a compact header, a split holds the room tabs (Kitchen, Living room, Bathroom), the visit in words with its week and what changed, and three facts about the job. At the end sits one drawn picture of the room in three layers: bare plaster with chalk lines, the room mid-job with dust sheets and a ladder, and the finished room. A slider with three stops (Before, During, After) runs beside the picture, up the side from lg and under it on a phone, and each step lifts the next layer from the foot of the picture. The pictures are drawn in the theme's greys, never photographs, and the studio, the jobs and the weeks are made up. It's built from Slider, Tabs and Guides, with CSS transitions for the reveal.

FAQ

How do I use it with a keyboard?

Tab goes to the room tabs and then to the slider's thumb. Home and End jump to Before and After, and the arrow keys step one stage at a time. The thumb is spoken as the stage ("During, stage 2 of 3"), and a polite line names the room, the stage and the note. On the Ark build the vertical slider answers Up and Down, and the horizontal one on a phone answers Left and Right; the other three bases accept either pair.

How does the reveal work?

The three stages are three drawings stacked in one box. A layer is shown once the slider has reached its stage, by a clip that opens from the foot of the picture upward, so moving the slider up rises the next layer over the last. Nothing moves the page, and under reduced motion the layers simply change place.

What changes when I pick another room?

The picture, the note and the three facts change; the slider keeps the stage you chose, so you can compare the kitchen and the bathroom at the same point in the job. The block's height stays the same for every room and stage.

Why are there two sliders in the markup?

A slider cannot change its direction with CSS, so a vertical one is drawn from lg and a horizontal one below it; the one that is hidden is not shown and cannot take focus. Both write the same stage.

How do I use my own photographs?

Each room has three stage descriptions and a scene per stage. Replace the Scene in a layer with <img alt="" className="size-full object-cover" src={…} /> (the picture's role="img" label already describes it) and keep the three layers the same size.

Are the weeks and crew sizes real?

No. They are written into the data as example figures for a made-up studio, so the page reads the same on the server and in the browser.

  • Pro

    Image Comparison Slider Gallery

    Compare, crop and zoom

    A graded drawn picture revealed over its original by a handle you drag or a slider you step, with Original and Graded labels, a percent readout and a picker of three pictures.

  • Pro

    A/B Vote Comparison Gallery

    Compare, crop and zoom

    Two designs of one poster side by side with a VS chip, a Prefer button under each, a seeded vote tally whose shares add to 100, and Change vote.

  • Pro

    Tabs of three workflows, each with a Before list where removed steps are struck through and an After list, a step count and one customer line.

  • Pro

    A Before and After control that cross-fades a settings screen between a cluttered version (warning banners, a nested menu, badges everywhere) and a clean one, in a frame that never changes height.

  • Pro

    A showcase hero with centred copy over a wide before and after panel in a hairline frame, with a draggable handle and a band of four results.

  • Pro

    Seasonal Year Scrubber Gallery

    Compare, crop and zoom

    One drawn orchard that follows a twelve-stop month slider: the sun's height and size, the leaves, the snow line and the ground's tone change, with the month in words and the job for it.