# @k8slens/lds-carousel

> Lens Design System – React Carousel component

Latest version **0.24.4** (published 2026-03-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @k8slens/lds-carousel
pnpm add @k8slens/lds-carousel
yarn add @k8slens/lds-carousel
bun add @k8slens/lds-carousel
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.24.4 |
| Published | 2026-03-13 |
| First published | 2024-04-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 55.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mirantis Inc |
| Maintainers | jakolehm, k8slens-bot, mirantis_it |

## Links

- npm: https://www.npmjs.com/package/@k8slens/lds-carousel
- npm.io page: https://npm.io/package/@k8slens/lds-carousel

## Dependencies (3)

- [@k8slens/lds](https://npm.io/package/@k8slens/lds.md) ^0.58.4
- [embla-carousel-react](https://npm.io/package/embla-carousel-react.md) 8.0.0-rc11
- [embla-carousel-autoplay](https://npm.io/package/embla-carousel-autoplay.md) 8.0.0-rc11

## Recent versions

- 0.24.4 (latest) — 2026-03-13
- 1.0.0-rc.6 (next) — 2026-04-02
- 1.0.0-rc.5 — 2026-03-19
- 1.0.0-rc.4 — 2026-03-19
- 1.0.0-rc.3 — 2026-03-18
- 1.0.0-rc.2 — 2026-03-16
- 1.0.0-rc.1 — 2026-03-16
- 0.24.3 — 2026-02-27
- 0.24.2 — 2026-02-24
- 0.24.1 — 2026-02-24
- 0.24.0 — 2026-02-16
- 0.23.2 — 2026-02-13
- 0.23.0 — 2026-01-16
- 0.22.0 — 2026-01-15
- 0.21.13 — 2026-01-15
- … 65 more at https://npm.io/package/@k8slens/lds-carousel/versions

## README

# @k8slens/lds-carousel

Carousel component for the Lens Design System – auto-playing slide carousel with dot navigation.

## Installation

```bash
npm install @k8slens/lds-carousel @k8slens/lds-tokens
```

## Setup

```tsx
import "@k8slens/lds-tokens/lib/electron/font-face.css";
import "@k8slens/lds/lib/es/index.css";
import "@k8slens/lds-carousel/lib/es/index.css";
```

## Usage

```tsx
import Carousel from "@k8slens/lds-carousel";

export const Component = () => (
  <Carousel>
    <img src="src" alt="Alt text" />
    <img src="src" alt="Alt text" />
    <img src="src" alt="Alt text" />
  </Carousel>
);
```

### Video Autoplay

To autoplay a video on the first slide:

```tsx
import { Carousel } from "@k8slens/lds-carousel";

export const Component = () => {
  const videoRef = React.useRef<HTMLVideoElement>(null);

  const [isVideoPlaying, setIsVideoPlaying] = useState(false);
  const [playing, setVideoPlaying] = useState(false);

  useEffect(() => {
    if (videoRef?.current && playing && !isVideoPlaying) {
      videoRef.current.play().catch(console.log);
    }
  }, [videoRef, playing, isVideoPlaying]);

  return (
    <Carousel isVideoPlaying={isVideoPlaying} setVideoPlaying={setVideoPlaying}>
      <video
        key="video-1" // Key must include "video"
        ref={videoRef}
        autoPlay={playing}
        src="video.mp4"
        muted // Mute video to avoid autoplay issues
        onPlay={() => setIsVideoPlaying(true)}
        onPause={() => setIsVideoPlaying(false)}
        onEnded={() => setIsVideoPlaying(false)}
      />
      <img src="src" alt="Alt text" />
      <img src="src" alt="Alt text" />
      <img src="src" alt="Alt text" />
    </Carousel>
  );
};
```

## Documentation

Browse examples at [lens-design-system.k8slens.dev](https://lens-design-system.k8slens.dev/?path=/docs/carousel).

## AI Assistance

This package includes an `llms.txt` file with API documentation optimized for LLMs. Add to your project's AI configuration (e.g., `AGENTS.md` or `CLAUDE.md`):

```markdown
Read node_modules/@k8slens/lds-carousel/llms.txt for carousel API reference.

Use the LDS Carousel component instead of custom implementations.
```

---
_Source: https://npm.io/package/@k8slens/lds-carousel · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
