Skip to content

Tour for Angular

AngularOverlays

Product tour and onboarding: a sequence of steps, each anchored to an element of the page (or centered), with a spotlight that dims the page around the target, Next, Back, Skip, and Finish buttons, and progress such as ‘2 of 5’. Every step is a dialog (non-modal by default, modal on request); focus moves into the step and returns when the tour ends; a step whose target is missing is skipped with an event.

  • SpotlightDims the page around the target with a CSS cut-out that follows scrolling and resizing, under a strict CSP.
  • A dialog per stepNon-modal by default, modal on request; focus moves into every step and returns when the tour ends.
  • Keyboard firstNext, Back, Skip, and Finish buttons, arrow keys mirrored in RTL, and Escape to skip.
  • Robust targetsElements, selectors, or functions; missing targets are skipped with an event, and hooks can open what a step needs.
  • Progress"2 of 5" announced with each step, optional dots, and targets scrolled into view.

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

import { Component } from '@angular/core';
import { AuiButton } from '@absoluteui/angular/button';
import { AuiTour } from '@absoluteui/angular/tour';
import type { TourFinishDetail, TourStep } from '@absoluteui/components/tour';
@Component({
selector: 'app-dashboard-tour',
imports: [AuiButton, AuiTour],
template: `
<button auiButton type="button" (click)="tour.start()">Take the tour</button>
<aui-tour #tour="auiTour" [steps]="steps" (finished)="onFinish($event)"></aui-tour>
`,
})
export class DashboardTourComponent {
readonly steps: TourStep[] = [
{ id: 'welcome', title: 'Welcome', content: 'A short tour of your dashboard.' },
{ id: 'search', title: 'Search', content: 'Find people and documents.', target: '#search' },
];
completed = false;
onFinish(detail: TourFinishDetail): void {
this.completed = detail.completed;
}
}
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 { AuiTour } from '@absoluteui/angular/tour';

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

Class AuiTour; template reference #ref="auiTour".

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

Input Type Default Description
steps readonly TourStep[] Required. The steps: { id, title, content?, target?, placement?, spotlightPadding?, onBeforeShow? }. target is an Element, a CSS selector, a function returning an Element, or null for a centered step.
dots boolean false Show decorative progress dots under the content.
skippable boolean true Show the Skip button (hidden on the last step).
keyboardNavigation boolean true Arrow keys move between steps while focus is on the panel or its buttons (mirrored in RTL).
modal boolean false Each step is a modal dialog: focus is trapped and the page is blocked.
closeOnEscape boolean true Escape skips the tour.
showProgress boolean true Show the ‘2 of 5’ progress text.
spotlight boolean true Dim the page around the target.
spotlightPadding number '8' Space between the target and the spotlight edge, px (0 to 64).
locale string 'en-US' Locale of the button labels and progress text.
Output Payload Description
(started) TourStartDetail The tour started: { index } of the first shown step. Re-emits aui-start.
(stepChange) TourStepChangeDetail A step is shown: { index, stepId, previousIndex, direction }. Re-emits aui-step-change.
(stepMissing) TourStepMissingDetail A step was skipped because its target is missing, hidden, or its hook failed: { index, stepId, reason }. Re-emits aui-step-missing.
(finished) TourFinishDetail The tour ended at its end: { index, completed } (completed is false when no later step could be shown). Re-emits aui-finish.
(skipped) TourSkipDetail The tour was skipped: { index, stepId, reason }. Re-emits aui-skip.

Call them through a viewChild query or a template reference.

Method Description
start(index?: number | undefined): Promise<void> | undefined Start (or restart) at index (default 0); steps with a missing target are skipped.
next(): Promise<void> | undefined Show the next available step; on the last step, finish.
back(): Promise<void> | undefined Show the previous available step.
goTo(index: number): Promise<void> | undefined Show the step at index (starts the tour when inactive).
skip(reason?: "skip-button" | "escape" | "programmatic" | undefined): void End the tour early and emit aui-skip.
finish(): void End the tour as completed and emit aui-finish.

Pattern: WAI-ARIA APG Dialog per step: a non-modal dialog by default (the page stays usable), or a modal dialog with aria-modal and a focus trap. Focus moves to the step dialog on every step and returns to the element that had focus before the tour.

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