shadcn.io is not affiliated with official shadcn/ui
Values Slider About Block for React
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.
Installation
Overview
A values slider for React with Base UI, written for Compasscove, a fictional HR platform. Six values are the slides of a carousel in a band that runs from rail to rail. Each slide sets the value and its sentence, a practice example from the company's own work, and one figure with what it counts, in three columns from lg with hairlines between them and stacked on a phone. In the header, at the end, are a "3 of 6" counter and Previous and Next buttons; under the slides a row of dots names every value and jumps to it. The carousel loops, swipes on touch screens and never advances by itself, so there is nothing to pause. It's built from Carousel, Button and Guides with a CSS entrance and your theme's tokens. For about pages and onboarding pages where each value deserves a moment and its proof. The figures are example data.
FAQ
How do I change the values?
Each slide is an entry in VALUES at the top of the file: a name, a one-sentence statement, a practice example, and a figure with the measure it counts. The counter, the dots and the carousel's slide count come from the length of the list, so you can add or remove a value without touching anything else. Keep the practice examples to two sentences: every slide is as tall as the tallest one.
How do I move through the values?
With the Previous and Next buttons, with the dots, with the arrow keys while a slide or either button has focus, and by swiping on a touch screen. Both ends wrap round. The dots are real buttons, each named with its value and position ("Say the number, value 2 of 6"), and the one on show is marked as current and drawn longer than the rest, so the state doesn't depend on colour.
Does it move by itself?
No. The slider only moves when someone asks it to, so there is no autoplay to pause and nothing that breaks the rule about moving content. Reduced motion needs nothing special for the same reason.
How do screen readers hear it?
The carousel is named "Company values", and each slide is a group named with its value and position. Slides that are off view are hidden from assistive technology, so only the visible one is read. After the first move a polite status line announces "Value 3 of 6" and the name; nothing is announced on load. Each slide's name is an h3 under the section's h2.
Does the carousel behave the same on every target?
It uses the Embla-based carousel: the block reads the selected slide from its API and moves it with scrollPrev, scrollNext and scrollTo, so the counter and the dots follow swipes too.
On every target the carousel loops, and the slide's three columns are the same.
How does it fit on a phone?
Below lg the three parts of a slide stack: the value, then its practice, then its figure, and every slide keeps the height of the tallest. Swiping moves between values; the buttons and each dot are at least 24 pixels square. The counter and buttons wrap under the heading on a phone, and nothing scrolls sideways at 320 pixels. The header and band fade up once on load; with reduced motion they simply appear.
Related
- Pro
Values Bento About
Culture and valuesA bento of six values for a community-forum company: three tall cells that each carry a story of what the value looked like in a nested quote, and three one-line cells stacked beside them, in shared hairlines.
- Pro
Values Cloud About
Culture and valuesA cloud of nine values for a writing app, sized by how often each wins when two disagree: pick a pill in a framed tray and a band under it says what the value means and what it costs us.
- Pro
Principles Rail About
Principles and processA split about section for a release-management tool: a sticky title at the start, and six principles as stations on a hairline rail, each opening to what it means and how it shows up.
- Pro
Mission Pillars About
StatementsA mission held up by four pillars for a civic-software company: cells that share their hairlines, each with its numeral, a sentence, three initiatives with shipped and in-progress marks, and a progress bar counted from the list.
- Pro
Quote Carousel Testimonials with Next-Speaker Preview
Carousels and decksA centred, looping carousel of large customer quotes in a card in a card, whose Previous and Next buttons preview who speaks next, with the neighbour's avatar and first name.
- Pro
Carousel Slider Features
Carousels and mediaA 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.