Skip to content

Carousel

Free

Photos, cards, or quotes that people move through one at a time, with arrows, dots, and a count. It works right to left.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Name the carousel with aria-label. Give each CarouselItem a basis-* class to show several slides at once.

trip-photos.tsx

Carousel

<section>
PropTypeDefaultDescription
...props<section> attributes—Every other attribute goes to the <section>, with a ref.

CarouselContent

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

CarouselItem

<fieldset>
PropTypeDefaultDescription
...props<fieldset> attributes—Every other attribute goes to the <fieldset>, with a ref.

CarouselPrevious

<button>
PropTypeDefaultDescription
rounded"default""full""full"
size"default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs""icon"
position"inside""outside""static"—
classNamestring—
variant"outline"A Button variant, or dark, light, clear (the Button media glass) on a picture.
From Base UIButtonBase UI docs
focusableWhenDisabledbooleanfalseWhether the button should be focusable when disabled.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

CarouselNext

<button>
PropTypeDefaultDescription
rounded"default""full""full"
size"default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs""icon"
position"inside""outside""static"—
classNamestring—
variant"outline"A Button variant, or dark, light, clear (the Button media glass) on a picture.
From Base UIButtonBase UI docs
focusableWhenDisabledbooleanfalseWhether the button should be focusable when disabled.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

CarouselDots

<div>
PropTypeDefaultDescription
variant"default""overlay"—
getLabel—The name of each dot. Default: the Carousel statusLabel ("Slide 2 of 5").
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

CarouselCounter

<span>
PropTypeDefaultDescription
...props<span> attributes—Every other attribute goes to the <span>, with a ref.
  • Use it for a set of slides that people move through one at a time: photos, cards, quotes.
  • Always give it a name with aria-label ("Trip photos"), so screen readers list it as a region.
  • At a phone width, use position="inside" or "static" for the buttons. The default outside buttons need 48px of room on each side.
  • To show every item at once, use a grid of cards.
  • For one picture, use an Image.
→Moves to the next stop when the focus is in the carousel. In right to left, it moves to the previous stop.
←Moves to the previous stop. In right to left, it moves to the next stop.
↓Moves to the next stop in a vertical carousel.
↑Moves to the previous stop in a vertical carousel.
TabMoves the focus to Previous, Next, the dots, and the links in the slides.

The carousel is a <section> with aria-roledescription="carousel". Name it with aria-label or aria-labelledby: a section with no name is not a region. In development it warns once.

Each slide is a <fieldset> (role group) with aria-roledescription="slide", named "2 of 5" by slideLabel. A slide with its own aria-label keeps it.

Translate slideLabel and the names of the buttons (aria-label).

Previous and Next keep keyboard focus when they disable at an end (aria-disabled), so the arrow keys keep working. Their touch target is 44px. The dots are 24px buttons, 44px high on touch, and the current dot has aria-current.

The arrow keys do nothing in a text field in a slide, so they move the text cursor there.

Slide move
embla · `duration` 25 (the Embla default) · a drag follows the pointer and settles on a stop
Press
press · 100ms · ease-out (0, 0, 0.2, 1) · Previous and Next move down 1px

Built with

Installs with Carousel

Components
Button
  1. AddedCarousel, with Button.
Open the release