Skip to content

Carousel for Angular

AngularData display

Shows one slide at a time from a set (featured items, an onboarding tour, image sets), following the WAI-ARIA APG carousel: a named region with roledescription ‘carousel’, slides labelled ‘N of M’, previous/next buttons and slide pickers, inert inactive slides. No autoplay by default; with autoplay, a pause button comes first, rotation pauses on hover and focus, and it does not start for reduced motion.

  • Accessible slidesEach slide is announced as N of M with an optional name.
  • Slide pickerOptional buttons to jump straight to any slide.
  • Loop and autoplayWrap around at the ends and rotate on a timer with a pause button.
  • Pauses for usersRotation stops on hover and focus, and respects reduced motion.

Behavior, design tokens, and limitations are described on the Carousel page; this page covers the Angular API.

import { Component } from '@angular/core';
import type { CarouselSlide } from '@absoluteui/components/carousel';
import { AuiCarousel } from '@absoluteui/angular/carousel';
@Component({
selector: 'app-announcements',
imports: [AuiCarousel],
template: `<aui-carousel label="Announcements" [slides]="slides" [loop]="true" [autoplay]="6000"></aui-carousel>`,
})
export class AnnouncementsComponent {
readonly slides: CarouselSlide[] = [{ content: 'The office is closed on Monday.' }, { content: 'Benefits enrollment closes on the 30th.' }];
}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiCarousel } from '@absoluteui/angular/carousel';

Defaults for every instance: provideAbsoluteUIConfig({ components: { carousel: { ... } } }) (see Configuration).

Class AuiCarousel; template reference #ref="auiCarousel".

Server rendering: Renders on the server; the browser re-creates it after hydration.

Input Type Default Description
label string Required. Accessible name of the carousel.
slides readonly CarouselSlide[] Required. Slides: { content: Node | string, label? } (1 to 100).
index number '0' Current slide (0-based).
loop boolean false Wrap from the last slide to the first and back.
autoplay number | null null Rotation interval in milliseconds (at least 2000), or null.
showPicker boolean true Show the slide picker buttons.
locale string 'en-US' Locale of the control labels and slide positions.
Output Payload Description
(changed) CarouselChangeDetail The user moved to another slide: { index }. Re-emits aui-change.

Call them through a viewChild query or a template reference.

Method Description
goTo(index: number): void Show a slide (no event); clamped, or wrapped with loop.
next(): void Show the next slide (no event).
previous(): void Show the previous slide (no event).

Pattern: WAI-ARIA APG Carousel (basic, with slide picker buttons): region with aria-roledescription ‘carousel’, slides as groups with aria-roledescription ‘slide’ and ‘N of M’ labels, rotation control first.

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Carousel: Accessibility and performance.