# CarouselApi (@salmonui/navigation/carousel)

> The CarouselApi interface of @salmonui/navigation/carousel: The ref instance.

Canonical: https://salmonui.dev/docs/reference/navigation/carousel/CarouselApi

```ts
import type { CarouselApi } from '@salmonui/navigation/carousel';
```

Entry index: https://salmonui.dev/docs/reference/navigation/carousel (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/navigation/carousel.md).

## Reference

Kind: interface

```ts
interface CarouselApi {
    readonly element: HTMLElement | null;
    readonly index: number;
    readonly playing: boolean;
    next(): void;
    previous(): void;
    goTo(index: number): void;
    play(): void;
    pause(): void;
}
```

The `ref` instance.

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `element` | `readonly element: HTMLElement \| null;` |  |  |
| `index` | `readonly index: number;` |  |  |
| `playing` | `readonly playing: boolean;` |  |  |
| `next` | `next(): void;` |  |  |
| `previous` | `previous(): void;` |  |  |
| `goTo` | `goTo(index: number): void;` |  |  |
| `play` | `play(): void;` |  |  |
| `pause` | `pause(): void;` |  |  |
