---
type: doc
title: Carousel Indicator
description: A thumbnail or dot that shows one slide of the shadcn/ui carousel and marks the current one.
---

> Fulldev UI React extension for an official shadcn/ui project. The `@fulldev` registry in `components.json` points at `https://ui.full.dev/r/react/styles/{style}/{name}.json`; see [installation](/react/docs/installation.md).

```tsx title="Usage of @fulldev/carousel-indicator (react/gallery/ui/carousel-indicator.tsx, not installed)"
import {
  Carousel,
  CarouselContent,
  CarouselItem,
} from "@/components/ui/carousel"
import { CarouselIndicator } from "@/components/ui/carousel-indicator"

export default function Demo() {
  return (
    <div className="flex flex-col gap-10 p-6">
      <Carousel aria-label="Product images" className="w-full max-w-xs">
        <CarouselContent>
          {[1, 2, 3].map((number) => (
            <CarouselItem key={number}>
              <div className="flex aspect-square items-center justify-center rounded-lg bg-muted text-4xl font-semibold">
                {number}
              </div>
            </CarouselItem>
          ))}
        </CarouselContent>
        <div className="mt-3 flex gap-2">
          {[1, 2, 3].map((number, index) => (
            <CarouselIndicator
              key={number}
              index={index}
              aria-label={`Show image ${number}`}
              className="flex size-14 items-center justify-center text-sm font-medium"
            >
              {number}
            </CarouselIndicator>
          ))}
        </div>
      </Carousel>
    </div>
  )
}
```

## Installation

```bash
npx shadcn@latest add @fulldev/carousel-indicator
```

This installs the [shadcn/ui carousel](https://ui.shadcn.com/docs/components/carousel)
too.

## Usage

```tsx
import { CarouselIndicator } from "@/components/ui/carousel-indicator"
```

```tsx
<Carousel aria-label="Product images">
  <CarouselContent>
    <CarouselItem>...</CarouselItem>
    <CarouselItem>...</CarouselItem>
  </CarouselContent>
  <CarouselIndicator index={0}>...</CarouselIndicator>
  <CarouselIndicator index={1}>...</CarouselIndicator>
</Carousel>
```

`CarouselIndicator` goes inside `Carousel` and scrolls to the zero-based
`index`, such as a thumbnail in a product gallery. The current one gets
`aria-current="true"` and `data-state="active"`. The index counts scroll
positions, which are the slides when one shows at a time; an indicator without
a position is hidden. Give it a size, such as `size-14`; an image inside fills
it.

## API Reference

Source: [`react/src/components/ui/carousel-indicator.tsx`](https://github.com/fulldotdev/ui/blob/main/react/src/components/ui/carousel-indicator.tsx)

## Install what this page shows

```bash
npx shadcn@latest add @fulldev/carousel-indicator
```
