Logo

Carousel

Preview

Composable scroll-snap carousel primitives with sizing, spacing, orientation, API, plugins, and RTL support.

Preview

Usage

TS

import { FrCarouselModule } from '@frame-ui-ng/components/carousel';

HTML

<section frCarousel>
  <div frCarouselContent>
    <div frCarouselItem>Slide 1</div>
    <div frCarouselItem>Slide 2</div>
    <div frCarouselItem>Slide 3</div>
  </div>
  <button frCarouselPrevious appearance="outline">
    <ng-icon name="tablerChevronLeft" size="18" />
  </button>
  <button frCarouselNext appearance="outline">
    <ng-icon name="tablerChevronRight" size="18" />
  </button>
</section>

Examples

Basic

A basic carousel with a scrollable content viewport, slide items, and controls.

Sizes

Set --frame-carousel-item-size to show multiple slides in the viewport, similar to basis utilities.

Spacing

Set --frame-carousel-gap on the root to control the distance between carousel items.

Orientation

Use orientation="vertical" for a vertical snap carousel.

Options

Pass opts to configure alignment, loop behavior, and direction from one object.

API

Use apiReady, selectedChange, and the carousel API to react to selection changes or control slides.

Plugins

Plugins receive the carousel API and may return a cleanup function for timers or listeners.

RTL support

Set direction through opts to render the scroll viewport and controls in right-to-left layouts.

Custom Styling

Override carousel tokens locally to tune slide width, gap, viewport radius, and control placement.

Token Inspector

Inspect the carousel root, scroll viewport, slide item, and positioned controls.

Design Tokens

Use these CSS custom properties to tune carousel spacing, slide sizing, viewport shape, and control placement.

SCSS


  --frame-carousel-gap: 1rem;
  --frame-carousel-item-size: 100%;
  --frame-carousel-control-offset: -3rem;
  --frame-carousel-control-size: 2.5rem;
  --frame-carousel-viewport-radius: var(--frame-radius-lg);
  --frame-carousel-vertical-size: 20rem;