Skip to content
shadcn.io

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.

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 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.

What happens with reduced motion?

The scale, tint and entrance transitions are skipped: the cards change state instantly. Moving between cards is always something you start yourself; nothing moves by itself.

How does it fit on a phone?

One card is about three quarters of the frame's width, with a sliver of each neighbour at the edges. The frame and its marks stay inset from the page's rails, and nothing scrolls sideways at 320 pixels.

  • Pro

    Peek Carousel Team

    Carousels and reels

    Twelve 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 media

    A 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 walls

    Four 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 walls

    The 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

    A 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 reels

    Six 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.