shadcn.io is not affiliated with official shadcn/ui
Centred Carousel Team Block for React
Seven people of a ceramics studio in a centred snap carousel: the middle card is full size and raised, its neighbours shrink and mute, and only the middle card is read and focusable.
Installation
Overview
A centred carousel team section for React with Base UI, for Tamsin & Vale, a ceramics studio. A centred header sits over a framed track with + marks at its corners. The card in the middle is full size and raised in your theme's card colour; the cards beside it shrink and take a muted tint, and the frame cuts them off at its edges. Previous and next buttons and a "2 of 7" count sit under the frame, and the arrow keys turn the cards too. Only the middle card is read by a screen reader and reachable by keyboard, and its name and place are announced when it changes. On a phone the track shows one card with a sliver of each neighbour. It's built from Carousel, Avatar, Badge, Button and Guides, with CSS transitions and your theme's tokens for every colour. For team pages that want to introduce one person at a time. Names and lines are made up for the example.
FAQ
How do I change the people?
Edit PEOPLE at the top of the file. A person is a name, a role, one line and two tags; the initials come from the name. The count and the wrap-around read the list's length.
How is the middle card centred and scaled?
The carousel is Embla with align: "center" and no trimmed snaps, so the first and last cards can sit in the middle.
The card whose page is current is the middle one. It gets full scale, the raised card style and the full text colour; every other card is scaled to 82%, with a muted solid tint and the muted text colour. The dimming is a tint and a text colour, never opacity, so every word keeps its contrast.
What does a screen reader hear?
Only the middle card. The others are inert and hidden from the reading order, so a keyboard and a screen reader meet one card at a time. A polite status line announces the new person and their place ("Anya Volkova, 2 of 7") when the card changes.
How do the controls work?
Previous and next wrap around, so a button is never disabled while it has focus. With focus on either button the arrow keys turn the cards too, and in a right-to-left page the arrows swap sides. A swipe or a drag snaps to the nearest card.
Related
- Pro
Peek Carousel Team
Carousels and reelsTwelve people of a farm-box service in a carousel that shows three cards and a cut-off fourth, with previous and next buttons, a 4 to 6 of 12 counter and a thin progress bar.
- Pro
Card Carousel Features
Carousels and mediaA multi-up carousel of seven capability cards for a product-tour builder, each led by a greyscale drawing, with the next card cut off at the rail and previous and next buttons in the heading row.
- Pro
Flip Cards Team
Grids and wallsFour people of a florist network as cards that turn over in 3D on a button press: the front is initials, a name and a role, the back a quote and two things to ask them about; reduced motion cross-fades.
- Pro
Department Bento Team
Grids and wallsThe six teams of a school-transport operator as a bento of cells that stand apart: the drivers fill a two-by-two cell with a large headcount and a group of avatars, and every other team has a headcount, a lead and a line on what it owns.
- 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
Gallery Spotlight Team
Carousels and reelsSix people of a lab-booking platform as a gallery: one person in a framed panel (an initials plate, name, role, quote, bio and three figures) over a filmstrip of six avatars that picks who is in focus.