;
+
+function CheckIcon(): ReactNode {
+ return (
+
+
+
+ );
+}
+
+export const StepListExample: StepListStory = {
+ render: (args: any) => (
+
+ Focus landing point
+
+ {steps.map(step => (
+
+ {({isCompleted, stepNumber}) => (
+
+ {isCompleted ? (
+
+ ) : (
+
+ {stepNumber}
+
+ )}
+
+ {step.label}
+
+
+ )}
+
+ ))}
+
+
+ )
+};
+
+export const StepListDynamic: StepListStory = {
+ render: (args: any) => (
+
+ Focus landing point
+
+ {(step: (typeof steps)[number]) => (
+
+ {({isCompleted, stepNumber}) => (
+
+ {isCompleted ? (
+
+ ) : (
+
+ {stepNumber}
+
+ )}
+
+ {step.label}
+
+
+ )}
+
+ )}
+
+
+ )
+};
+
+export const StepListLinks: StepListStory = {
+ render: (args: any) => (
+
+ Focus landing point
+
+ {(step: (typeof steps)[number]) => (
+
+ {({isCompleted, stepNumber}) => (
+
+ {isCompleted ? (
+
+ ) : (
+
+ {stepNumber}
+
+ )}
+ {/* Every step has an href, but only completed steps can be navigated back to. */}
+
+ {step.label}
+
+
+ )}
+
+ )}
+
+
+ )
+};
diff --git a/packages/react-aria-components/stories/Wizard.css b/packages/react-aria-components/stories/Wizard.css
new file mode 100644
index 00000000000..fd662aa0a5f
--- /dev/null
+++ b/packages/react-aria-components/stories/Wizard.css
@@ -0,0 +1,115 @@
+.wizard {
+ /* Width of the chevron notch cut into each end of a step. */
+ --arrow: 14px;
+ /* How far a step slides under the previous one so the chevrons interlock. */
+ --overlap: 12px;
+ --padding: 12px;
+
+ .react-aria-WizardStepList {
+ display: flex;
+ overflow-x: auto;
+ overflow-y: hidden;
+ border-radius: 16px;
+ background: var(--spectrum-global-color-gray-300);
+ }
+
+ .react-aria-WizardStep {
+ display: flex;
+ flex: 1 1 0;
+ align-items: center;
+ gap: 8px;
+ min-width: 0;
+ padding: 8px calc(var(--arrow) + var(--padding));
+ margin-left: calc(-1 * var(--overlap));
+ background: var(--spectrum-global-color-gray-200);
+ outline: none;
+ cursor: pointer;
+ clip-path: polygon(
+ 0 0,
+ calc(100% - var(--arrow)) 0,
+ 100% 50%,
+ calc(100% - var(--arrow)) 100%,
+ 0 100%,
+ var(--arrow) 50%
+ );
+
+ &:first-child {
+ padding-left: var(--padding);
+ margin-left: 0;
+ clip-path: polygon(
+ 0 0,
+ calc(100% - var(--arrow)) 0,
+ 100% 50%,
+ calc(100% - var(--arrow)) 100%,
+ 0 100%
+ );
+ }
+
+ &:last-child {
+ padding-right: var(--padding);
+ clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, var(--arrow) 50%);
+ }
+
+ &[data-selected],
+ &[data-hovered] {
+ background: var(--spectrum-global-color-gray-100);
+ }
+
+ /* Steps that are not navigable yet, or every step but the current one when read only. */
+ &[data-disabled] {
+ cursor: default;
+ }
+
+ &[data-focus-visible] .marker {
+ outline: 2px solid var(--spectrum-alias-focus-ring-color);
+ outline-offset: 2px;
+ }
+ }
+
+ .marker {
+ display: flex;
+ flex-shrink: 0;
+ align-items: center;
+ justify-content: center;
+ width: 32px;
+ height: 32px;
+ border-radius: 9999px;
+ background: var(--spectrum-global-color-gray-400);
+ color: var(--spectrum-global-color-gray-800);
+ font-size: 14px;
+ }
+
+ [data-completed] .marker {
+ background: var(--spectrum-global-color-green-600);
+ color: var(--spectrum-global-color-gray-50);
+ }
+
+ [data-current] .marker {
+ background: var(--spectrum-global-color-blue-600);
+ color: var(--spectrum-global-color-gray-50);
+ }
+
+ .text {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+ overflow: hidden;
+ }
+
+ .label,
+ .position {
+ overflow: hidden;
+ font-size: 12px;
+ line-height: 1.5;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+
+ .label {
+ color: var(--spectrum-global-color-gray-800);
+ }
+
+ .position {
+ color: var(--spectrum-global-color-gray-700);
+ }
+}
diff --git a/packages/react-aria-components/stories/Wizard.stories.tsx b/packages/react-aria-components/stories/Wizard.stories.tsx
new file mode 100644
index 00000000000..490f771448c
--- /dev/null
+++ b/packages/react-aria-components/stories/Wizard.stories.tsx
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2026 Adobe. All rights reserved.
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
+ * OF ANY KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+
+import {Meta, StoryObj} from '@storybook/react';
+import React, {ReactNode} from 'react';
+import {Wizard, WizardStep, WizardStepList} from '../src/Wizard';
+import './Wizard.css';
+
+const steps = [
+ {id: 'domain', label: 'Domain/Sender details'},
+ {id: 'dns', label: 'Configure DNS'},
+ {id: 'advanced', label: 'Advanced settings'}
+];
+
+export default {
+ title: 'React Aria Components/Wizard',
+ component: Wizard,
+ args: {
+ allowsRandomAccess: false
+ }
+} as Meta;
+
+export type WizardStory = StoryObj;
+
+function CheckIcon(): ReactNode {
+ return (
+
+
+
+ );
+}
+
+// The number and check mark repeat the label and the state that `WizardStep` already announces,
+// so they are decorative.
+function StepMarker({
+ isCompleted,
+ stepNumber
+}: {
+ isCompleted: boolean;
+ stepNumber: number;
+}): ReactNode {
+ return (
+
+ {isCompleted ? : stepNumber}
+
+ );
+}
+
+export const WizardExample: WizardStory = {
+ render: (args: any) => (
+
+ Focus landing point
+
+
+ {steps.map(step => (
+
+ {({isCompleted, stepNumber}) => (
+ <>
+
+
+ {step.label}
+
+ Step {stepNumber} of {steps.length}
+
+
+ >
+ )}
+
+ ))}
+
+
+
+ )
+};
diff --git a/packages/react-aria-components/test/StepList.test.js b/packages/react-aria-components/test/StepList.test.js
new file mode 100644
index 00000000000..e610eb6fe60
--- /dev/null
+++ b/packages/react-aria-components/test/StepList.test.js
@@ -0,0 +1,429 @@
+/*
+ * Copyright 2026 Adobe. All rights reserved.
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
+ * OF ANY KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+
+import {pointerMap, render} from '@react-spectrum/test-utils-internal';
+import React from 'react';
+import {StepList, StepListContext, StepListItem, StepListItemContent} from '../src/StepList';
+import userEvent from '@testing-library/user-event';
+
+let steps = [
+ {id: 'domain', label: 'Domain'},
+ {id: 'dns', label: 'DNS'},
+ {id: 'advanced', label: 'Advanced'}
+];
+
+let renderStepList = (listProps, itemProps) =>
+ render(
+
+ {steps.map(step => (
+
+ {step.label}
+
+ ))}
+
+ );
+
+describe('StepList', () => {
+ let user;
+ beforeAll(() => {
+ user = userEvent.setup({delay: null, pointerMap});
+ });
+
+ it('should render with default classes', () => {
+ let {getByRole, getAllByRole} = renderStepList();
+ expect(getByRole('list')).toHaveClass('react-aria-StepList');
+
+ for (let item of getAllByRole('listitem')) {
+ expect(item).toHaveClass('react-aria-StepListItem');
+ }
+ });
+
+ it('should render with custom classes', () => {
+ let {getByRole, getAllByRole} = renderStepList({className: 'steps'}, {className: 'step'});
+ expect(getByRole('list')).toHaveClass('steps');
+
+ for (let item of getAllByRole('listitem')) {
+ expect(item).toHaveClass('step');
+ }
+ });
+
+ it('should mark steps before the selected step as completed', () => {
+ let {getAllByRole} = renderStepList();
+ let items = getAllByRole('listitem');
+
+ expect(items[0]).toHaveAttribute('data-completed');
+ expect(items[0]).not.toHaveAttribute('data-current');
+ expect(items[0]).not.toHaveAttribute('aria-current');
+
+ expect(items[1]).toHaveAttribute('data-current');
+ expect(items[1]).toHaveAttribute('aria-current', 'step');
+ expect(items[1]).not.toHaveAttribute('data-completed');
+
+ expect(items[2]).not.toHaveAttribute('data-completed');
+ expect(items[2]).not.toHaveAttribute('data-current');
+ });
+
+ it('should update completed steps when the selected step changes', () => {
+ let {getAllByRole, rerender} = renderStepList({selectedKey: 'advanced'});
+ let items = getAllByRole('listitem');
+ expect(items[0]).toHaveAttribute('data-completed');
+ expect(items[1]).toHaveAttribute('data-completed');
+ expect(items[2]).toHaveAttribute('data-current');
+
+ rerender(
+
+ {steps.map(step => (
+
+ {step.label}
+
+ ))}
+
+ );
+
+ items = getAllByRole('listitem');
+ expect(items[0]).toHaveAttribute('data-current');
+ expect(items[1]).not.toHaveAttribute('data-completed');
+ expect(items[2]).not.toHaveAttribute('data-completed');
+ });
+
+ it('should mark no steps as completed when the selected step is not in the collection', () => {
+ let {getAllByRole} = renderStepList({selectedKey: 'nope'});
+
+ for (let item of getAllByRole('listitem')) {
+ expect(item).not.toHaveAttribute('data-completed');
+ expect(item).not.toHaveAttribute('data-current');
+ }
+ });
+
+ it('should support dynamic collections', () => {
+ let {getAllByRole} = render(
+
+ {step => (
+
+ {step.label}
+
+ )}
+
+ );
+
+ let items = getAllByRole('listitem');
+ expect(items.map(item => item.textContent)).toEqual([
+ 'CompletedDomain',
+ 'CurrentDNS',
+ 'Not completedAdvanced'
+ ]);
+ expect(items[0]).toHaveAttribute('data-completed');
+ expect(items[1]).toHaveAttribute('data-current');
+ });
+
+ it('should support render props', () => {
+ let {getAllByRole} = render(
+
+ {step => (
+
+ {({isCurrent, isCompleted}) => (
+
+ {isCurrent ? 'current' : isCompleted ? 'completed' : step.label}
+
+ )}
+
+ )}
+
+ );
+
+ expect(getAllByRole('listitem').map(item => item.lastChild.textContent)).toEqual([
+ 'completed',
+ 'current',
+ 'Advanced'
+ ]);
+ });
+
+ it('should provide a 1-based step number to render props', () => {
+ let {getAllByRole} = render(
+
+ {() => (
+
+ {({stepNumber}) => {`Step ${stepNumber}`} }
+
+ )}
+
+ );
+
+ expect(getAllByRole('listitem').map(item => item.lastChild.textContent)).toEqual([
+ 'Step 1',
+ 'Step 2',
+ 'Step 3'
+ ]);
+ });
+
+ it('should provide the step number to className and style functions', () => {
+ let {getAllByRole} = render(
+
+ {step => (
+ `step-${stepNumber}`}
+ style={({stepNumber}) => ({order: stepNumber})}>
+ {step.label}
+
+ )}
+
+ );
+
+ let items = getAllByRole('listitem');
+ expect(items.map(item => item.className)).toEqual(['step-1', 'step-2', 'step-3']);
+ expect(items.map(item => item.style.order)).toEqual(['1', '2', '3']);
+ });
+
+ it('should support DOM props', () => {
+ let {getByRole, getAllByRole} = renderStepList(
+ {'data-foo': 'bar', 'aria-label': 'test list'},
+ {'data-bar': 'foo', 'aria-label': 'test item'}
+ );
+
+ let list = getByRole('list');
+ expect(list).toHaveAttribute('data-foo', 'bar');
+ expect(list).toHaveAttribute('aria-label', 'test list');
+
+ for (let item of getAllByRole('listitem')) {
+ expect(item).toHaveAttribute('data-bar', 'foo');
+ expect(item).toHaveAttribute('aria-label', 'test item');
+ }
+ });
+
+ it('should not forward the step id to the DOM', () => {
+ let {getAllByRole} = renderStepList();
+
+ for (let item of getAllByRole('listitem')) {
+ expect(item).not.toHaveAttribute('id');
+ }
+ });
+
+ it('should support custom render function', () => {
+ let {getByRole, getAllByRole} = renderStepList(
+ {render: props => },
+ {render: props => }
+ );
+
+ expect(getByRole('list')).toHaveAttribute('data-custom', 'bar');
+ for (let item of getAllByRole('listitem')) {
+ expect(item).toHaveAttribute('data-custom', 'true');
+ }
+ });
+
+ it('should support refs', () => {
+ let listRef = React.createRef();
+ let itemRef = React.createRef();
+ let {getByRole} = render(
+
+
+ A
+
+
+ );
+
+ expect(listRef.current).toBe(getByRole('list'));
+ expect(itemRef.current).toBe(getByRole('listitem'));
+ });
+
+ it('should support slots', () => {
+ let {getByRole} = render(
+
+
+
+ A
+
+
+
+ );
+
+ let list = getByRole('list');
+ expect(list).toHaveAttribute('slot', 'test');
+ expect(list).toHaveAttribute('aria-label', 'test');
+ });
+
+ it('should label StepListItemContent with the step state', () => {
+ let {getByRole} = render(
+
+
+ Step A
+
+
+ );
+
+ let step = getByRole('img');
+ let [stateId, contentId] = step.getAttribute('aria-labelledby').split(' ');
+ expect(document.getElementById(stateId)).toHaveTextContent('Current');
+ expect(contentId).toBe(step.id);
+ });
+
+ it.each([undefined, '#a'])(
+ 'should label StepListItemContent with the step state and custom aria-labelledby when href is %s',
+ href => {
+ let {getByRole} = render(
+ <>
+ Custom step
+ Details
+
+
+
+ Step A
+
+
+
+ >
+ );
+
+ let content = getByRole(href ? 'link' : 'img');
+ let status = getByRole('listitem').querySelector('[hidden]');
+ expect(status).toHaveTextContent('Current');
+ expect(content).toHaveAttribute('aria-labelledby', `${status.id} step-label step-detail`);
+ expect(content).toHaveAccessibleName('Current Custom step Details');
+ }
+ );
+
+ it('should support className and style on StepListItemContent', () => {
+ let {getByRole, rerender} = render(
+
+
+ Step A
+
+
+ );
+
+ expect(getByRole('img')).toHaveClass('react-aria-StepListItemContent');
+
+ rerender(
+
+
+
+ Step A
+
+
+
+ );
+
+ let content = getByRole('img');
+ expect(content).toHaveClass('content');
+ expect(content).not.toHaveClass('react-aria-StepListItemContent');
+ expect(content.style.color).toBe('red');
+ });
+
+ it('should support custom render function on StepListItemContent', () => {
+ let {getByRole} = render(
+
+
+ {
+ if ('href' in props) {
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
+ return ;
+ }
+ return
;
+ }}>
+ Step A
+
+
+
+
}>
+ Step B
+
+
+
+ );
+
+ let link = getByRole('link');
+ expect(link).toHaveAttribute('data-custom', 'link');
+ expect(link).toHaveAttribute('href', '#a');
+ expect(link).toHaveClass('react-aria-StepListItemContent');
+ expect(getByRole('img')).toHaveAttribute('data-custom', 'content');
+ });
+
+ it('should render StepListItemContent as a non-focusable div without an href', () => {
+ let {getByRole} = render(
+
+
+ Step A
+
+
+ );
+
+ let content = getByRole('img');
+ expect(content.tagName).toBe('DIV');
+ expect(content).toHaveAttribute('role', 'img');
+ expect(content).not.toHaveAttribute('tabindex');
+ expect(content).not.toHaveAttribute('href');
+ });
+
+ it('should render StepListItemContent as an anchor when an href is provided', () => {
+ let {getAllByRole} = render(
+
+ {step => (
+
+ {({isCompleted}) => (
+
+ {step.label}
+
+ )}
+
+ )}
+
+ );
+
+ let contents = [...getAllByRole('link'), ...getAllByRole('img')];
+ expect(contents).toHaveLength(3);
+
+ // Completed step gets the href.
+ expect(contents[0].tagName).toBe('A');
+ expect(contents[0]).toHaveAttribute('href', '#domain');
+ expect(contents[0]).not.toHaveAttribute('role');
+
+ // Current and upcoming steps do not.
+ for (let content of contents.slice(1)) {
+ expect(content.tagName).toBe('DIV');
+ expect(content).toHaveAttribute('role', 'img');
+ expect(content).not.toHaveAttribute('href');
+ }
+ });
+
+ it('should reset focus state when a focused link is replaced by a non-link', async () => {
+ let renderSteps = selectedKey => (
+
+ {step => (
+
+ {({isCompleted}) => (
+
+ {step.label}
+
+ )}
+
+ )}
+
+ );
+ let {getByRole, getAllByRole, rerender} = render(renderSteps('dns'));
+
+ await user.tab();
+ let link = getByRole('link');
+ expect(document.activeElement).toBe(link);
+ expect(link).toHaveAttribute('data-focus-visible', 'true');
+
+ // Navigating to the focused step makes it current, so it is no longer a link.
+ rerender(renderSteps('domain'));
+ for (let content of getAllByRole('img')) {
+ expect(content).not.toHaveAttribute('data-focus-visible');
+ }
+
+ // The step becomes a link again, but is not focused.
+ rerender(renderSteps('dns'));
+ expect(getByRole('link')).not.toHaveAttribute('data-focus-visible');
+ });
+});
diff --git a/packages/react-aria-components/test/Wizard.test.js b/packages/react-aria-components/test/Wizard.test.js
new file mode 100644
index 00000000000..abe554c2425
--- /dev/null
+++ b/packages/react-aria-components/test/Wizard.test.js
@@ -0,0 +1,679 @@
+/*
+ * Copyright 2026 Adobe. All rights reserved.
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
+ * OF ANY KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+
+import {act, pointerMap, render, within} from '@react-spectrum/test-utils-internal';
+import React, {useContext, useState} from 'react';
+import {TabListStateContext} from '../src/Tabs';
+import userEvent from '@testing-library/user-event';
+import {Wizard, WizardPanel, WizardPanels, WizardStep, WizardStepList} from '../src/Wizard';
+
+let steps = [
+ {id: 'domain', label: 'Domain'},
+ {id: 'dns', label: 'DNS'},
+ {id: 'advanced', label: 'Advanced'},
+ {id: 'review', label: 'Review'}
+];
+let keys = steps.map(step => step.id);
+
+function WizardExample({stepProps, children, ...props}) {
+ return (
+
+
+ {steps.map(step => (
+
+ {step.label}
+
+ ))}
+
+
+ {steps.map(step => (
+
+ {step.label} panel
+
+ ))}
+
+ {children}
+
+ );
+}
+
+// Moves the selection from within the wizard, like the Previous and Continue buttons of a wizard.
+function StepButtons() {
+ let state = useContext(TabListStateContext);
+ if (!state) {
+ return null;
+ }
+
+ let index = keys.indexOf(state.selectedKey);
+ return (
+ <>
+ state.setSelectedKey(keys[index - 1])}>
+ Previous
+
+ = keys.length - 1}
+ onClick={() => state.setSelectedKey(keys[index + 1])}>
+ Continue
+
+ >
+ );
+}
+
+// The selected step is controlled by the parent, which moves it with Back and Next buttons.
+function ControlledWizard({onSelectionChange, ...props}) {
+ let [selectedKey, setSelectedKey] = useState('domain');
+ let index = keys.indexOf(selectedKey);
+ return (
+ <>
+ {
+ onSelectionChange?.(key);
+ setSelectedKey(key);
+ }}
+ />
+ setSelectedKey(keys[index - 1])}>Back
+ setSelectedKey(keys[index + 1])}>Next
+ >
+ );
+}
+
+function getSelectedStep(tree) {
+ let tabs = tree.getAllByRole('tab');
+ return keys[tabs.findIndex(tab => tab.getAttribute('aria-selected') === 'true')];
+}
+
+function getNavigableSteps(tree) {
+ return tree
+ .getAllByRole('tab')
+ .flatMap((tab, i) => (tab.getAttribute('aria-disabled') === 'true' ? [] : [keys[i]]));
+}
+
+describe('Wizard', () => {
+ let user;
+
+ beforeAll(() => {
+ user = userEvent.setup({delay: null, pointerMap});
+ jest.useFakeTimers();
+ });
+
+ afterEach(() => {
+ act(() => jest.runAllTimers());
+ });
+
+ it('should render a step list and the panel of the selected step', () => {
+ let tree = render( );
+ let stepList = tree.getByRole('tablist');
+ expect(stepList).toHaveAttribute('aria-label', 'Setup');
+
+ let tabs = within(stepList).getAllByRole('tab');
+ expect(tabs).toHaveLength(4);
+ expect(getSelectedStep(tree)).toBe('domain');
+
+ let panel = tree.getByRole('tabpanel');
+ expect(panel).toHaveTextContent('Domain panel');
+ expect(tabs[0]).toHaveAttribute('aria-controls', panel.id);
+ });
+
+ it('should render with default classes', () => {
+ let tree = render( );
+ let stepList = tree.getByRole('tablist');
+ expect(stepList.parentElement).toHaveClass('react-aria-Wizard');
+ expect(stepList).toHaveClass('react-aria-WizardStepList');
+ for (let step of within(stepList).getAllByRole('tab')) {
+ expect(step).toHaveClass('react-aria-WizardStep');
+ }
+
+ let panel = tree.getByRole('tabpanel');
+ expect(panel.parentElement).toHaveClass('react-aria-WizardPanels');
+ expect(panel).toHaveClass('react-aria-WizardPanel');
+ });
+
+ it('should pass the default class name to className functions', () => {
+ let tree = render(
+ `${defaultClassName} wizard`}
+ stepProps={() => ({className: ({defaultClassName}) => `${defaultClassName} step`})}
+ />
+ );
+ let stepList = tree.getByRole('tablist');
+ expect(stepList.parentElement).toHaveClass('react-aria-Wizard', 'wizard');
+ for (let step of within(stepList).getAllByRole('tab')) {
+ expect(step).toHaveClass('react-aria-WizardStep', 'step');
+ }
+ });
+
+ it('should support uncontrolled selection', async () => {
+ let onSelectionChange = jest.fn();
+ let tree = render(
+
+ );
+ expect(getSelectedStep(tree)).toBe('dns');
+ expect(tree.getByRole('tabpanel')).toHaveTextContent('DNS panel');
+
+ await user.click(tree.getAllByRole('tab')[0]);
+ expect(onSelectionChange).toHaveBeenCalledTimes(1);
+ expect(onSelectionChange).toHaveBeenLastCalledWith('domain');
+ expect(getSelectedStep(tree)).toBe('domain');
+ expect(tree.getByRole('tabpanel')).toHaveTextContent('Domain panel');
+ });
+
+ it('should support controlled selection', async () => {
+ let onSelectionChange = jest.fn();
+ let tree = render( );
+
+ await user.click(tree.getAllByRole('tab')[0]);
+ expect(onSelectionChange).toHaveBeenCalledTimes(1);
+ expect(onSelectionChange).toHaveBeenLastCalledWith('domain');
+ expect(getSelectedStep(tree)).toBe('dns');
+ });
+
+ it('should identify only the selected step as the current step for assistive technology', async () => {
+ let tree = render( );
+ let tabs = tree.getAllByRole('tab');
+ expect(tabs[0]).toHaveAttribute('aria-current', 'step');
+ for (let tab of tabs.slice(1)) {
+ expect(tab).not.toHaveAttribute('aria-current');
+ }
+
+ await user.click(tabs[2]);
+ expect(tabs[2]).toHaveAttribute('aria-current', 'step');
+ for (let tab of [tabs[0], tabs[1], tabs[3]]) {
+ expect(tab).not.toHaveAttribute('aria-current');
+ }
+ });
+
+ it('should only select a step on Enter when navigating with the keyboard', async () => {
+ let onSelectionChange = jest.fn();
+ let tree = render(
+
+ );
+ let tabs = tree.getAllByRole('tab');
+
+ await user.tab();
+ expect(document.activeElement).toBe(tabs[0]);
+
+ await user.keyboard('{ArrowRight}');
+ expect(document.activeElement).toBe(tabs[1]);
+ await user.keyboard('{ArrowRight}');
+ expect(document.activeElement).toBe(tabs[2]);
+ expect(getSelectedStep(tree)).toBe('domain');
+ expect(onSelectionChange).not.toHaveBeenCalled();
+
+ // The last step isn't navigable yet, so it is skipped.
+ await user.keyboard('{ArrowRight}');
+ expect(document.activeElement).toBe(tabs[0]);
+ await user.keyboard('{ArrowLeft}');
+ expect(document.activeElement).toBe(tabs[2]);
+
+ await user.keyboard('{Enter}');
+ expect(onSelectionChange).toHaveBeenCalledTimes(1);
+ expect(onSelectionChange).toHaveBeenLastCalledWith('advanced');
+ expect(getSelectedStep(tree)).toBe('advanced');
+ });
+
+ it('should mark the steps before the selected step as completed and retain memory when going back', async () => {
+ let tree = render( );
+ let tabs = tree.getAllByRole('tab');
+
+ expect(tabs.map(tab => tab.textContent)).toEqual([
+ 'CompletedDomain',
+ 'CompletedDNS',
+ 'Advanced',
+ 'Not completedReview'
+ ]);
+ expect(tabs[0]).toHaveAttribute('data-completed');
+ expect(tabs[1]).toHaveAttribute('data-completed');
+ expect(tabs[2]).toHaveAttribute('data-current');
+ expect(tabs[2]).not.toHaveAttribute('data-completed');
+ expect(tabs[3]).not.toHaveAttribute('data-completed');
+ expect(tabs[3]).not.toHaveAttribute('data-current');
+
+ // Completion follows the selection moving forwards. But it does not change
+ // going back to earlier steps.
+ await user.click(tabs[0]);
+ expect(tabs.map(tab => tab.textContent)).toEqual([
+ 'Domain',
+ 'CompletedDNS',
+ 'Not completedAdvanced',
+ 'Not completedReview'
+ ]);
+ expect(tabs[0]).toHaveAttribute('data-current');
+ expect(tabs[0]).toHaveAttribute('data-completed');
+ expect(tabs[1]).toHaveAttribute('data-completed');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns', 'advanced']);
+ });
+
+ it('should provide the step state as render props', async () => {
+ let tree = render(
+
+
+ {steps.map(step => (
+
+ isCurrent ? 'current' : isCompleted ? 'completed' : 'upcoming'
+ }
+ style={({isCurrent}) => ({fontWeight: isCurrent ? 'bold' : 'normal'})}
+ render={(domProps, {stepNumber}) =>
}>
+ {({stepNumber}) => `${stepNumber}. ${step.label}`}
+
+ ))}
+
+
+ );
+
+ let tabs = tree.getAllByRole('tab');
+ expect(tabs.map(tab => tab.className)).toEqual([
+ 'completed',
+ 'completed',
+ 'current',
+ 'upcoming'
+ ]);
+ expect(tabs.map(tab => tab.textContent)).toEqual([
+ 'Completed1. Domain',
+ 'Completed2. DNS',
+ '3. Advanced',
+ 'Not completed4. Review'
+ ]);
+ expect(tabs.map(tab => tab.style.fontWeight)).toEqual(['normal', 'normal', 'bold', 'normal']);
+ expect(tabs.map(tab => tab.dataset.step)).toEqual(['1', '2', '3', '4']);
+
+ await user.click(tabs[0]);
+ expect(tabs.map(tab => tab.className)).toEqual([
+ 'current',
+ 'completed',
+ 'upcoming',
+ 'upcoming'
+ ]);
+ });
+
+ it('should support render props on steps', () => {
+ let tree = render(
+
+
+ {steps.map(step => (
+
+ {({isSelected, isDisabled}) =>
+ `${step.label} ${isSelected ? 'selected' : isDisabled ? 'locked' : 'open'}`
+ }
+
+ ))}
+
+
+ );
+
+ expect(tree.getAllByRole('tab').map(tab => tab.textContent)).toEqual([
+ 'CompletedDomain open',
+ 'DNS selected',
+ 'Not completedAdvanced locked',
+ 'Not completedReview locked'
+ ]);
+ });
+
+ it('should support refs', () => {
+ let wizardRef = React.createRef();
+ let stepListRef = React.createRef();
+ let stepRef = React.createRef();
+ let panelsRef = React.createRef();
+ let panelRef = React.createRef();
+ let tree = render(
+
+
+
+ Domain
+
+
+
+
+ Domain panel
+
+
+
+ );
+
+ expect(stepListRef.current).toBe(tree.getByRole('tablist'));
+ expect(wizardRef.current).toBe(tree.getByRole('tablist').parentElement);
+ expect(stepRef.current).toBe(tree.getByRole('tab'));
+ expect(panelRef.current).toBe(tree.getByRole('tabpanel'));
+ expect(panelsRef.current).toBe(tree.getByRole('tabpanel').parentElement);
+ });
+
+ describe('lastCompletedStep', () => {
+ it.each([
+ ['no steps are completed', {}],
+ ['lastCompletedStep is not one of the steps', {lastCompletedStep: 'missing'}]
+ ])('should only allow navigating to the first step when %s', async (_, props) => {
+ let onSelectionChange = jest.fn();
+ let onLastCompletedStepChange = jest.fn();
+ let tree = render(
+
+ );
+ expect(getNavigableSteps(tree)).toEqual(['domain']);
+
+ await user.click(tree.getAllByRole('tab')[1]);
+ expect(getSelectedStep(tree)).toBe('domain');
+ expect(onSelectionChange).not.toHaveBeenCalled();
+ expect(onLastCompletedStepChange).not.toHaveBeenCalled();
+ });
+
+ it('should allow navigating to completed steps and the step after the last completed step', async () => {
+ let onLastCompletedStepChange = jest.fn();
+ let tree = render(
+
+ );
+ expect(getSelectedStep(tree)).toBe('domain');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns', 'advanced']);
+ let tabs = tree.getAllByRole('tab');
+ expect(tabs[0]).toHaveAttribute('data-current');
+ expect(tabs[0]).toHaveAttribute('data-completed');
+ expect(tabs[1]).toHaveAccessibleName('Completed DNS');
+ expect(tabs[1]).toHaveAttribute('data-completed');
+ expect(tabs[2]).not.toHaveAttribute('data-completed');
+ expect(tabs[3]).not.toHaveAttribute('data-completed');
+
+ // Selecting the step after the last completed step doesn't complete any more steps.
+ await user.click(tree.getAllByRole('tab')[2]);
+ expect(getSelectedStep(tree)).toBe('advanced');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns', 'advanced']);
+ expect(onLastCompletedStepChange).not.toHaveBeenCalled();
+ });
+
+ it('should not complete any steps when the default selected step follows the last completed step', () => {
+ let onLastCompletedStepChange = jest.fn();
+ let tree = render(
+
+ );
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns']);
+ expect(onLastCompletedStepChange).not.toHaveBeenCalled();
+ });
+
+ it('should complete the steps before the default selected step', () => {
+ let onLastCompletedStepChange = jest.fn();
+ // Records every step that is rendered as disabled.
+ let disabledSteps = new Set();
+ let tree = render(
+
+
+ {steps.map(step => (
+
+ {({isDisabled}) => {
+ if (isDisabled) {
+ disabledSteps.add(step.id);
+ }
+ return step.label;
+ }}
+
+ ))}
+
+
+ );
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns', 'advanced']);
+
+ // The last completed step is derived during render rather than synced in an effect, so the
+ // completed steps are never rendered as disabled.
+ expect(disabledSteps).toEqual(new Set(['review']));
+ // Like other default values, the derived last completed step doesn't call the change handler.
+ expect(onLastCompletedStepChange).not.toHaveBeenCalled();
+ });
+
+ it('should complete steps as the selection advances and keep them navigable after going back', async () => {
+ let onLastCompletedStepChange = jest.fn();
+ let tree = render(
+
+
+
+ );
+ let previous = tree.getByRole('button', {name: 'Previous'});
+ let next = tree.getByRole('button', {name: 'Continue'});
+
+ await user.click(next);
+ expect(getSelectedStep(tree)).toBe('dns');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns']);
+ expect(onLastCompletedStepChange).toHaveBeenCalledTimes(1);
+ expect(onLastCompletedStepChange).toHaveBeenLastCalledWith('domain');
+
+ await user.click(next);
+ expect(getSelectedStep(tree)).toBe('advanced');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns', 'advanced']);
+ expect(onLastCompletedStepChange).toHaveBeenCalledTimes(2);
+ expect(onLastCompletedStepChange).toHaveBeenLastCalledWith('dns');
+
+ // Going back never rolls back an uncontrolled last completed step.
+ await user.click(previous);
+ expect(getSelectedStep(tree)).toBe('dns');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns', 'advanced']);
+
+ await user.click(tree.getAllByRole('tab')[0]);
+ expect(getSelectedStep(tree)).toBe('domain');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns', 'advanced']);
+
+ // The furthest step reached can be selected again directly.
+ await user.click(tree.getAllByRole('tab')[2]);
+ expect(getSelectedStep(tree)).toBe('advanced');
+ expect(onLastCompletedStepChange).toHaveBeenCalledTimes(2);
+ });
+
+ it('should derive the last completed step when the parent changes the selection', async () => {
+ let onLastCompletedStepChange = jest.fn();
+ let tree = render( );
+ let back = tree.getByRole('button', {name: 'Back'});
+ let next = tree.getByRole('button', {name: 'Next'});
+
+ await user.click(next);
+ expect(getSelectedStep(tree)).toBe('dns');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns']);
+
+ await user.click(next);
+ expect(getSelectedStep(tree)).toBe('advanced');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns', 'advanced']);
+
+ // Going back never rolls back an uncontrolled last completed step, even when the selection is
+ // controlled.
+ await user.click(back);
+ expect(getSelectedStep(tree)).toBe('dns');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns', 'advanced']);
+
+ // The parent changed the selection itself rather than through the wizard, so it isn't notified
+ // about the steps that the selection completed.
+ expect(onLastCompletedStepChange).not.toHaveBeenCalled();
+ });
+
+ it('should support a controlled lastCompletedStep', () => {
+ let onLastCompletedStepChange = jest.fn();
+ let tree = render(
+
+ );
+ expect(getNavigableSteps(tree)).toEqual(keys);
+ let tabs = tree.getAllByRole('tab');
+ expect(tabs.map(tab => tab.hasAttribute('data-completed'))).toEqual([
+ true,
+ true,
+ true,
+ false
+ ]);
+
+ // Unlike an uncontrolled last completed step, a controlled one can be rolled back.
+ tree.rerender(
+
+ );
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns']);
+ expect(tabs.map(tab => tab.hasAttribute('data-completed'))).toEqual([
+ true,
+ false,
+ false,
+ false
+ ]);
+ expect(tabs[1]).toHaveAccessibleName('Not completed DNS');
+
+ tree.rerender(
+
+ );
+ expect(getNavigableSteps(tree)).toEqual(['domain']);
+ for (let tab of tabs) {
+ expect(tab).not.toHaveAttribute('data-completed');
+ }
+ expect(onLastCompletedStepChange).not.toHaveBeenCalled();
+ });
+
+ it.each(['lastCompletedStep', 'defaultLastCompletedStep'])(
+ 'should mark a step with key zero as completed with %s',
+ prop => {
+ let tree = render(
+
+
+ First
+ Second
+
+
+ );
+ let tabs = tree.getAllByRole('tab');
+ expect(tabs[0]).toHaveAttribute('data-current');
+ expect(tabs[0]).toHaveAttribute('data-completed');
+ expect(tabs[1]).not.toHaveAttribute('data-completed');
+ expect(tabs[1]).not.toHaveAttribute('aria-disabled');
+ }
+ );
+
+ it('should request completing steps without updating a controlled lastCompletedStep', async () => {
+ let onLastCompletedStepChange = jest.fn();
+ let tree = render(
+
+
+
+ );
+ let next = tree.getByRole('button', {name: 'Continue'});
+
+ // Selecting the step after the last completed step doesn't complete any more steps.
+ await user.click(next);
+ expect(getSelectedStep(tree)).toBe('dns');
+ expect(onLastCompletedStepChange).not.toHaveBeenCalled();
+
+ await user.click(next);
+ expect(getSelectedStep(tree)).toBe('advanced');
+ expect(onLastCompletedStepChange).toHaveBeenCalledTimes(1);
+ expect(onLastCompletedStepChange).toHaveBeenLastCalledWith('dns');
+
+ // The last completed step is still "domain", so the step after "dns" isn't navigable once
+ // the selection moves away from it.
+ await user.click(tree.getByRole('button', {name: 'Previous'}));
+ expect(getSelectedStep(tree)).toBe('dns');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns']);
+ });
+
+ it('should call onLastCompletedStepChange in the same event as onSelectionChange', async () => {
+ // Records each pair of values that the parent renders with. Strict mode renders twice, so
+ // only changes are recorded.
+ let renders = [];
+ function FullyControlledWizard() {
+ let [selectedKey, setSelectedKey] = useState('domain');
+ let [lastCompletedStep, setLastCompletedStep] = useState(null);
+ if (renders.at(-1)?.join() !== [selectedKey, lastCompletedStep].join()) {
+ renders.push([selectedKey, lastCompletedStep]);
+ }
+
+ return (
+
+
+
+ );
+ }
+
+ let tree = render( );
+ let previous = tree.getByRole('button', {name: 'Previous'});
+ let next = tree.getByRole('button', {name: 'Continue'});
+
+ await user.click(next);
+ expect(getSelectedStep(tree)).toBe('dns');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns']);
+
+ await user.click(next);
+ expect(getSelectedStep(tree)).toBe('advanced');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns', 'advanced']);
+
+ await user.click(previous);
+ expect(getSelectedStep(tree)).toBe('dns');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns', 'advanced']);
+
+ // Both values are updated together, so the parent never renders a selected step that is
+ // ahead of the step after the last completed step.
+ expect(renders).toEqual([
+ ['domain', null],
+ ['dns', 'domain'],
+ ['advanced', 'dns'],
+ ['dns', 'dns']
+ ]);
+ });
+
+ it('should keep the selected step navigable when it is beyond the step after the last completed step', () => {
+ let tree = render( );
+ expect(getSelectedStep(tree)).toBe('review');
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'dns', 'review']);
+ });
+
+ it('should allow navigating to any step with allowsRandomAccess', async () => {
+ let onLastCompletedStepChange = jest.fn();
+ let tree = render(
+
+ );
+ expect(getNavigableSteps(tree)).toEqual(keys);
+
+ await user.click(tree.getAllByRole('tab')[3]);
+ expect(getSelectedStep(tree)).toBe('review');
+ expect(onLastCompletedStepChange).toHaveBeenCalledTimes(1);
+ expect(onLastCompletedStepChange).toHaveBeenLastCalledWith('advanced');
+ });
+
+ it.each([
+ ['disabledKeys', {disabledKeys: ['dns']}],
+ ['isDisabled', {stepProps: step => ({isDisabled: step.id === 'dns'})}]
+ ])('should never allow navigating to steps disabled with %s', async (_, disabledProps) => {
+ let tree = render( );
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'advanced', 'review']);
+ tree.unmount();
+
+ tree = render( );
+ expect(getNavigableSteps(tree)).toEqual(['domain', 'advanced', 'review']);
+
+ await user.click(tree.getAllByRole('tab')[1]);
+ expect(getSelectedStep(tree)).toBe('domain');
+ });
+ });
+});
diff --git a/starters/docs/src/StepList.css b/starters/docs/src/StepList.css
new file mode 100644
index 00000000000..c5a4cfa4f27
--- /dev/null
+++ b/starters/docs/src/StepList.css
@@ -0,0 +1,97 @@
+@import './theme.css';
+
+.react-aria-StepList {
+ display: flex;
+ max-width: 100%;
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ font: var(--font-size) system-ui;
+ color: var(--text-color);
+}
+
+.react-aria-StepListItem {
+ position: relative;
+ /* Steps share the available width equally, with a preferred width of 96px. */
+ flex: 1;
+ width: calc(var(--spacing) * 24);
+ box-sizing: border-box;
+ padding-inline: var(--spacing-1);
+ display: flex;
+ justify-content: center;
+
+ .marker {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: var(--spacing-6);
+ height: var(--spacing-6);
+ box-sizing: border-box;
+ border: 1px solid var(--border-color);
+ border-radius: 50%;
+ font-size: var(--font-size-sm);
+ }
+
+ &[data-current] .marker,
+ &[data-completed] .marker {
+ background: var(--highlight-background);
+ border-color: var(--highlight-background);
+ color: var(--highlight-foreground);
+ forced-color-adjust: none;
+ }
+
+ &[data-current] {
+ font-weight: 600;
+ }
+
+ /* Connector lines. Each step draws the lines on either side of its marker,
+ so they stay centered when steps have different widths. */
+ &::before,
+ &::after {
+ content: '';
+ position: absolute;
+ top: var(--spacing-3);
+ border-top: 1px solid var(--border-color);
+ }
+
+ &::before {
+ inset-inline: 0 calc(50% + var(--spacing-5));
+ }
+
+ &::after {
+ inset-inline: calc(50% + var(--spacing-5)) 0;
+ }
+
+ &:first-child::before,
+ &:last-child::after {
+ display: none;
+ }
+
+ &[data-current]::before,
+ &[data-completed]::before,
+ &[data-completed]::after {
+ border-color: var(--highlight-background);
+ }
+}
+
+.react-aria-StepListItemContent {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: var(--spacing-2);
+ text-align: center;
+ color: inherit;
+ text-decoration: none;
+ border-radius: var(--radius-sm);
+ outline: none;
+ -webkit-tap-highlight-color: transparent;
+
+ &[data-hovered] {
+ text-decoration: underline;
+ }
+
+ &[data-focus-visible] {
+ outline: 2px solid var(--focus-ring-color);
+ outline-offset: 2px;
+ }
+}
diff --git a/starters/docs/src/StepList.tsx b/starters/docs/src/StepList.tsx
new file mode 100644
index 00000000000..4ed094b256e
--- /dev/null
+++ b/starters/docs/src/StepList.tsx
@@ -0,0 +1,52 @@
+'use client';
+import {
+ StepList as RACStepList,
+ type StepListProps,
+ StepListItem as RACStepListItem,
+ type StepListItemProps as RACStepListItemProps,
+ StepListItemContent,
+ type StepListItemContentProps
+} from 'react-aria-components/StepList';
+import {Check} from 'lucide-react';
+import {createContext, type ReactNode, useContext} from 'react';
+import './StepList.css';
+
+const RenderLinkContext = createContext(undefined);
+
+export function StepList({
+ renderLink,
+ ...props
+}: StepListProps & {renderLink?: StepListItemContentProps['render']}) {
+ return (
+
+
+
+ );
+}
+
+export interface StepListItemProps extends Omit {
+ children?: ReactNode;
+ href?: string;
+}
+
+export function StepListItem({children, href, ...props}: StepListItemProps) {
+ let renderLink = useContext(RenderLinkContext);
+ return (
+
+ {({isCompleted, stepNumber}) => {
+ // Only completed steps are links, so users can go back but not skip ahead.
+ let isLink = isCompleted && href != null;
+ return (
+
+
+ {isCompleted ? : stepNumber}
+
+ {children}
+
+ );
+ }}
+
+ );
+}
diff --git a/starters/docs/src/Wizard.css b/starters/docs/src/Wizard.css
new file mode 100644
index 00000000000..229b1e33917
--- /dev/null
+++ b/starters/docs/src/Wizard.css
@@ -0,0 +1,112 @@
+@import './theme.css';
+
+.react-aria-Wizard {
+ display: flex;
+ flex-direction: column;
+ gap: var(--spacing-4);
+ width: calc(var(--spacing) * 100);
+ max-width: 100%;
+ font: var(--font-size) system-ui;
+ color: var(--text-color);
+}
+
+.react-aria-WizardStepList {
+ display: flex;
+}
+
+.react-aria-WizardStep {
+ position: relative;
+ flex: 1;
+ box-sizing: border-box;
+ padding-inline: var(--spacing-1);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: var(--spacing-2);
+ text-align: center;
+ outline: none;
+ cursor: default;
+ -webkit-tap-highlight-color: transparent;
+
+ .marker {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: var(--spacing-6);
+ height: var(--spacing-6);
+ box-sizing: border-box;
+ border: 1px solid var(--border-color);
+ border-radius: 50%;
+ font-size: var(--font-size-sm);
+ }
+
+ &[data-selected] .marker,
+ &[data-completed] .marker {
+ background: var(--highlight-background);
+ border-color: var(--highlight-background);
+ color: var(--highlight-foreground);
+ forced-color-adjust: none;
+ }
+
+ &[data-selected] {
+ font-weight: 600;
+ }
+
+ &[data-hovered] {
+ color: var(--text-color-hover);
+ }
+
+ /* Steps the user hasn't reached yet. */
+ &[data-disabled] {
+ color: var(--text-color-disabled);
+ }
+
+ &[data-focus-visible] .marker {
+ outline: 2px solid var(--focus-ring-color);
+ outline-offset: 2px;
+ }
+
+ /* Connector lines. Each step draws the lines on either side of its marker,
+ so they stay centered when steps have different widths. */
+ &::before,
+ &::after {
+ content: '';
+ position: absolute;
+ top: var(--spacing-3);
+ border-top: 1px solid var(--border-color);
+ }
+
+ &::before {
+ inset-inline: 0 calc(50% + var(--spacing-5));
+ }
+
+ &::after {
+ inset-inline: calc(50% + var(--spacing-5)) 0;
+ }
+
+ &:first-child::before,
+ &:last-child::after {
+ display: none;
+ }
+
+ &[data-selected]::before,
+ &[data-completed]::before,
+ &[data-completed]::after {
+ border-color: var(--highlight-background);
+ }
+}
+
+.react-aria-WizardPanel {
+ padding: var(--spacing-3);
+ border-radius: var(--radius);
+ outline: none;
+
+ &[data-focus-visible] {
+ outline: 2px solid var(--focus-ring-color);
+ }
+}
+
+.wizard-buttons {
+ display: flex;
+ justify-content: space-between;
+}
diff --git a/starters/docs/src/Wizard.tsx b/starters/docs/src/Wizard.tsx
new file mode 100644
index 00000000000..2f37d4e2138
--- /dev/null
+++ b/starters/docs/src/Wizard.tsx
@@ -0,0 +1,76 @@
+'use client';
+import {
+ Wizard as RACWizard,
+ WizardPanel as RACWizardPanel,
+ type WizardPanelProps,
+ WizardPanels as RACWizardPanels,
+ type WizardPanelsProps,
+ type WizardProps,
+ WizardStep as RACWizardStep,
+ WizardStepList as RACWizardStepList,
+ type WizardStepListProps,
+ type WizardStepProps
+} from 'react-aria-components/Wizard';
+import {TabListStateContext} from 'react-aria-components/Tabs';
+import {composeRenderProps} from 'react-aria-components/composeRenderProps';
+import {Check} from 'lucide-react';
+import {useContext} from 'react';
+import {Button} from './Button';
+import './Wizard.css';
+
+export function Wizard(props: WizardProps) {
+ return ;
+}
+
+export function WizardStepList(props: WizardStepListProps) {
+ return ;
+}
+
+export function WizardStep(props: WizardStepProps) {
+ return (
+
+ {composeRenderProps(props.children, (children, {isCompleted, stepNumber}) => (
+ <>
+ {/* The step already announces whether it is completed, so the marker is hidden. */}
+
+ {isCompleted ? : stepNumber}
+
+ {children}
+ >
+ ))}
+
+ );
+}
+
+export function WizardPanels(props: WizardPanelsProps) {
+ return ;
+}
+
+export function WizardPanel(props: WizardPanelProps) {
+ return ;
+}
+
+// Back and Next buttons that move between steps. Render inside the , outside .
+export function WizardButtons() {
+ let state = useContext(TabListStateContext);
+ if (!state || state.selectedKey == null) {
+ return null;
+ }
+
+ let {collection, selectedKey, setSelectedKey} = state;
+ let previousKey = collection.getKeyBefore(selectedKey);
+ let nextKey = collection.getKeyAfter(selectedKey);
+ return (
+
+ setSelectedKey(previousKey)}>
+ Back
+
+ setSelectedKey(nextKey)}>
+ Next
+
+
+ );
+}
diff --git a/starters/docs/stories/StepList.stories.tsx b/starters/docs/stories/StepList.stories.tsx
new file mode 100644
index 00000000000..eaeb4364229
--- /dev/null
+++ b/starters/docs/stories/StepList.stories.tsx
@@ -0,0 +1,33 @@
+import {StepList, StepListItem} from '../src/StepList';
+import type {Meta, StoryFn} from '@storybook/react';
+
+const meta: Meta = {
+ component: StepList,
+ parameters: {
+ layout: 'centered'
+ },
+ tags: ['autodocs'],
+ args: {
+ selectedKey: 'payment'
+ }
+};
+
+export default meta;
+type Story = StoryFn;
+
+export const Example: Story = args => (
+
+
+ Cart
+
+
+ Shipping
+
+
+ Payment
+
+
+ Review
+
+
+);
diff --git a/starters/docs/stories/Wizard.stories.tsx b/starters/docs/stories/Wizard.stories.tsx
new file mode 100644
index 00000000000..e55449576c5
--- /dev/null
+++ b/starters/docs/stories/Wizard.stories.tsx
@@ -0,0 +1,40 @@
+import {
+ Wizard,
+ WizardButtons,
+ WizardPanel,
+ WizardPanels,
+ WizardStep,
+ WizardStepList
+} from '../src/Wizard';
+import {fn} from 'storybook/test';
+import type {Meta, StoryFn} from '@storybook/react';
+
+const meta: Meta = {
+ component: Wizard,
+ parameters: {
+ layout: 'centered'
+ },
+ args: {
+ onSelectionChange: fn()
+ },
+ tags: ['autodocs']
+};
+
+export default meta;
+type Story = StoryFn;
+
+export const Example: Story = args => (
+
+
+ Details
+ Members
+ Review
+
+
+ Name your project and choose who can see it.
+ Invite people to work on the project with you.
+ Check the details, then create the project.
+
+
+
+);
diff --git a/starters/tailwind/src/StepList.tsx b/starters/tailwind/src/StepList.tsx
new file mode 100644
index 00000000000..95d9f4c85c9
--- /dev/null
+++ b/starters/tailwind/src/StepList.tsx
@@ -0,0 +1,78 @@
+'use client';
+import {Check} from 'lucide-react';
+import React, {createContext, useContext} from 'react';
+import {
+ StepList as AriaStepList,
+ StepListItem as AriaStepListItem,
+ StepListItemContent as AriaStepListItemContent,
+ type StepListItemContentProps,
+ type StepListItemProps as AriaStepListItemProps,
+ type StepListProps
+} from 'react-aria-components/StepList';
+import {twMerge} from 'tailwind-merge';
+import {tv} from 'tailwind-variants';
+import {composeTailwindRenderProps} from './utils';
+
+const RenderLinkContext = createContext(undefined);
+
+export function StepList({
+ renderLink,
+ ...props
+}: StepListProps & {renderLink?: StepListItemContentProps['render']}) {
+ return (
+
+
+
+ );
+}
+
+export interface StepListItemProps extends Omit {
+ children?: React.ReactNode;
+ href?: string;
+}
+
+const markerStyles = tv({
+ base: 'flex items-center justify-center size-6 shrink-0 rounded-full border text-xs',
+ variants: {
+ isUpcoming: {
+ true: 'border-neutral-400',
+ false:
+ 'border-transparent bg-blue-600 text-white forced-color-adjust-none forced-colors:bg-[Highlight] forced-colors:text-[HighlightText]'
+ }
+ }
+});
+
+export function StepListItem({children, href, ...props}: StepListItemProps) {
+ let renderLink = useContext(RenderLinkContext);
+ return (
+
+ {({isCurrent, isCompleted, stepNumber}) => {
+ // Only completed steps are links, so users can go back but not skip ahead.
+ let isLink = isCompleted && href != null;
+ return (
+
+
+ {isCompleted ? : stepNumber}
+
+ {children}
+
+ );
+ }}
+
+ );
+}
diff --git a/starters/tailwind/src/Wizard.tsx b/starters/tailwind/src/Wizard.tsx
new file mode 100644
index 00000000000..68518ca8d77
--- /dev/null
+++ b/starters/tailwind/src/Wizard.tsx
@@ -0,0 +1,125 @@
+'use client';
+import {Check} from 'lucide-react';
+import React, {useContext} from 'react';
+import {composeRenderProps} from 'react-aria-components/composeRenderProps';
+import {TabListStateContext} from 'react-aria-components/Tabs';
+import {
+ Wizard as AriaWizard,
+ WizardPanel as AriaWizardPanel,
+ type WizardPanelProps,
+ WizardPanels as AriaWizardPanels,
+ type WizardPanelsProps,
+ type WizardProps,
+ WizardStep as AriaWizardStep,
+ WizardStepList as AriaWizardStepList,
+ type WizardStepListProps,
+ type WizardStepProps
+} from 'react-aria-components/Wizard';
+import {tv} from 'tailwind-variants';
+import {Button} from './Button';
+import {composeTailwindRenderProps, focusRing} from './utils';
+
+export function Wizard(props: WizardProps) {
+ return (
+
+ );
+}
+
+export function WizardStepList(props: WizardStepListProps) {
+ return (
+
+ );
+}
+
+const markerStyles = tv({
+ extend: focusRing,
+ base: 'flex items-center justify-center size-6 shrink-0 rounded-full border text-xs',
+ variants: {
+ isUpcoming: {
+ true: 'border-neutral-400',
+ false:
+ 'border-transparent bg-blue-600 text-white forced-color-adjust-none forced-colors:bg-[Highlight] forced-colors:text-[HighlightText]'
+ }
+ }
+});
+
+export function WizardStep(props: WizardStepProps) {
+ return (
+
+ {composeRenderProps(
+ props.children,
+ (children, {isSelected, isCompleted, isFocusVisible, stepNumber}) => (
+ <>
+ {/* The step already announces whether it is completed, so the marker is hidden. */}
+
+ {isCompleted ? : stepNumber}
+
+ {children}
+ >
+ )
+ )}
+
+ );
+}
+
+export function WizardPanels(props: WizardPanelsProps) {
+ return ;
+}
+
+const panelStyles = tv({
+ extend: focusRing,
+ base: 'box-border p-4 text-sm text-neutral-900 dark:text-neutral-100'
+});
+
+export function WizardPanel(props: WizardPanelProps) {
+ return (
+
+ panelStyles({...renderProps, className})
+ )}
+ />
+ );
+}
+
+// Back and Next buttons that move between steps. Render inside the , outside .
+export function WizardButtons() {
+ let state = useContext(TabListStateContext);
+ if (!state || state.selectedKey == null) {
+ return null;
+ }
+
+ let {collection, selectedKey, setSelectedKey} = state;
+ let previousKey = collection.getKeyBefore(selectedKey);
+ let nextKey = collection.getKeyAfter(selectedKey);
+ return (
+
+ setSelectedKey(previousKey)}>
+ Back
+
+ setSelectedKey(nextKey)}>
+ Next
+
+
+ );
+}
diff --git a/starters/tailwind/stories/StepList.stories.tsx b/starters/tailwind/stories/StepList.stories.tsx
new file mode 100644
index 00000000000..60d848111f5
--- /dev/null
+++ b/starters/tailwind/stories/StepList.stories.tsx
@@ -0,0 +1,33 @@
+import React from 'react';
+import {StepList, StepListItem} from '../src/StepList';
+import {type Meta} from '@storybook/react';
+
+const meta: Meta = {
+ component: StepList,
+ parameters: {
+ layout: 'centered'
+ },
+ tags: ['autodocs'],
+ args: {
+ selectedKey: 'payment'
+ }
+};
+
+export default meta;
+
+export const Example = (args: any) => (
+
+
+ Cart
+
+
+ Shipping
+
+
+ Payment
+
+
+ Review
+
+
+);
diff --git a/starters/tailwind/stories/Wizard.stories.tsx b/starters/tailwind/stories/Wizard.stories.tsx
new file mode 100644
index 00000000000..2fd42f8f8e5
--- /dev/null
+++ b/starters/tailwind/stories/Wizard.stories.tsx
@@ -0,0 +1,36 @@
+import React from 'react';
+import {
+ Wizard,
+ WizardButtons,
+ WizardPanel,
+ WizardPanels,
+ WizardStep,
+ WizardStepList
+} from '../src/Wizard';
+import {type Meta} from '@storybook/react';
+
+const meta: Meta = {
+ component: Wizard,
+ parameters: {
+ layout: 'centered'
+ },
+ tags: ['autodocs']
+};
+
+export default meta;
+
+export const Example = (args: any) => (
+
+
+ Details
+ Members
+ Review
+
+
+ Name your project and choose who can see it.
+ Invite people to work on the project with you.
+ Check the details, then create the project.
+
+
+
+);