Veil UI
Components

Carousel Item

A single slide within a carousel track.

Installation

$ npx veil-ui@latest add carousel-item

Usage

import { CarouselItem } from "@/components/ui/carousel-item";

<CarouselItem>Slide content</CarouselItem>;

Examples

Basic

One slide of content

Two-up

Design
Engineering

API reference

  • Renders a role="group" slide with aria-roledescription="slide" and a full-width basis.
  • orientation adjusts vertical padding for carousels that scroll on the Y axis.
  • The carousel package re-exports the same component, so either import works.

Accessibility

  • Slides expose their role and roledescription to screen readers.
  • Use with the Carousel region so arrow-key navigation applies.
  • Keep slide content meaningful without the visual track context.

Vue and plain HTML

This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add carousel-item --framework vue or switch the framework in components.json.

<script setup lang="ts">
import { cn } from "@/lib/utils";

const props = withDefaults(
  defineProps<{
    orientation?: "horizontal" | "vertical";
    class?: string;
  }>(),
  { orientation: "horizontal" },
);
</script>

<template>
  <div
    role="group"
    aria-roledescription="slide"
    data-slot="carousel-item"
    :class="
      cn(
        'min-w-0 shrink-0 grow-0 basis-full',
        props.orientation === 'vertical' ? 'pt-4' : 'pl-4',
        props.class,
      )
    "
  >
    <slot />
  </div>
</template>

On this page