shadcn.io is not affiliated with official shadcn/ui
Card Stack Team Block for React
Six people of a perfume subscription as a deck of overlapping profile cards in a framed figure, each card peeking 16 px under the one above, with Previous and Next buttons, a counter and only the top card focusable.
Installation
Overview
A team section for React with Base UI, for Osprelle, a perfume subscription. A heading and one sentence sit beside a framed figure that holds a deck of six profile cards: each card is an initials avatar, a name, a specific role, a line of what to ask them about, a city and a "Say hello" link. The cards overlap, each peeking 16 px under the one above it. Previous brings the last card to the top and Next sends the top card to the back, with a "2 of 6" counter between them. Only the top card can be focused, and a polite line names who is on top. Under reduced motion the cards swap without sliding. On a phone the deck sits under the heading and the buttons under the deck. It's built from Avatar, Button and Guides, with CSS transitions and your theme's tokens for every colour. For a short team that you want to browse rather than list.
FAQ
How do I change the people?
Edit PEOPLE at the top of the file: a person is a name, a role, an ask sentence (it follows "Ask me about") and a city. The counter and the buttons' wrap-around come from the array's length. Cards are a fixed height, so keep each ask to about two lines.
Why can only the top card be focused?
The cards underneath are covered, so a link in one would take focus to something nobody can see. They are marked inert, which takes them out of the tab order and the accessibility tree; Previous and Next bring each one to the top. The counter is a polite live region that reads the name and position ("Tariq Mansour, 2 of 6") when the deck changes, so a screen reader user hears who is on top without leaving the button.
How do I move through the deck with a keyboard?
Tab to Previous or Next and press Enter or Space; the focus stays on the button, so you can press it again. The deck wraps in both directions. The top card's "Say hello" link is the first Tab stop in the block, before the buttons.
How is the peek drawn?
Every card sits in the same place and is moved by its depth: the card below the top is lowered by 16 px and narrowed slightly from its bottom edge, so exactly 16 px of it shows; the third and fourth step down again, and the rest wait behind the fourth, hidden. When the top card goes to the back it slides down behind the others.
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
Centred Carousel Team
Carousels and reelsSeven 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.
- 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
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.
- Pro
Grid Cards Team
Grids and wallsTwelve people of a restaurant-software company in a hairline grid that runs from rail to rail, each an initials avatar with a name, a role, a department badge and a city, under a department picker that brings the picked team to the front and dims everyone else.
- Pro
Stories Viewer Team
Carousels and reelsFive teammates of a crop-planning app as a stories viewer: five segments that fill in turn, one sentence at a time in large type, a visible Pause, Previous and Next buttons, arrow keys and swipe.