Steps
リニアおよびノンリニアなナビゲーションで、ユーザーを複数ステップのワークフローに案内します。
Stepsには専用のWAI-ARIA APGパターンはありません。Stepsはセマンティックな順序付きリスト(Steps.List内に<ol>、Steps.Item内に<li>)を使用し、アクティブなステップアイテムにaria-current="step"を設定し、装飾用のインジケーターやセパレーターをaria-hidden="true"で非表示にします。
import { component$, useStyles$ } from '@builder.io/qwik';
import { Steps } from '@leve-ui/steps';
import styles from './default.css?inline';
export default component$(() => {
useStyles$(styles);
return (
<Steps.Root count={3} class="steps-default">
<Steps.List class="steps-default-list">
<Steps.Item index={0} class="steps-default-item">
<Steps.Trigger class="steps-default-trigger">
<Steps.Indicator class="steps-default-indicator">1</Steps.Indicator>
<span>Account</span>
</Steps.Trigger>
<Steps.Separator class="steps-default-separator" />
</Steps.Item>
<Steps.Item index={1} class="steps-default-item">
<Steps.Trigger class="steps-default-trigger">
<Steps.Indicator class="steps-default-indicator">2</Steps.Indicator>
<span>Profile</span>
</Steps.Trigger>
<Steps.Separator class="steps-default-separator" />
</Steps.Item>
<Steps.Item index={2} class="steps-default-item">
<Steps.Trigger class="steps-default-trigger">
<Steps.Indicator class="steps-default-indicator">3</Steps.Indicator>
<span>Review</span>
</Steps.Trigger>
</Steps.Item>
</Steps.List>
<Steps.Content index={0} class="steps-default-content">
Enter your email and password to create an account.
</Steps.Content>
<Steps.Content index={1} class="steps-default-content">
Add your display name and profile details.
</Steps.Content>
<Steps.Content index={2} class="steps-default-content">
Confirm your information before submitting.
</Steps.Content>
<div class="steps-default-actions">
<Steps.PrevTrigger class="steps-default-nav">Previous</Steps.PrevTrigger>
<Steps.NextTrigger class="steps-default-nav">Next</Steps.NextTrigger>
</div>
</Steps.Root>
);
});.steps-default {
width: 440px;
max-width: 100%;
font-family: inherit;
color: light-dark(#0f172a, #ffffff);
}
.steps-default-list {
display: flex;
align-items: center;
list-style: none;
margin: 0;
padding: 0;
}
.steps-default-item {
display: flex;
align-items: center;
flex: 1;
}
.steps-default-item:last-child {
flex: none;
}
.steps-default-trigger {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.25rem 0.375rem;
border: none;
border-radius: 6px;
background: transparent;
color: light-dark(#475569, #c9ddf0);
font-family: inherit;
font-size: 0.875rem;
font-weight: 500;
white-space: nowrap;
cursor: pointer;
}
.steps-default-trigger[data-state="current"],
.steps-default-trigger[data-state="complete"] {
color: light-dark(#0f172a, #ffffff);
}
.steps-default-trigger:hover:not([data-disabled]) {
background: light-dark(#f1f5f9, #ffffff14);
}
.steps-default-trigger:focus-visible,
.steps-default-nav:focus-visible {
outline: 2px solid #009dfd;
outline-offset: 2px;
}
.steps-default-indicator {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.75rem;
height: 1.75rem;
border-radius: 9999px;
border: 1px solid light-dark(#cbd5e1, #ffffff3d);
background: light-dark(#ffffff, #1b2045);
color: light-dark(#475569, #c9ddf0);
font-size: 0.75rem;
font-weight: 600;
flex-shrink: 0;
}
/* Active step indicator */
.steps-default-indicator[data-state="current"] {
border-color: #009dfd;
background: #009dfd;
color: #ffffff;
}
/* Completed step indicator */
.steps-default-indicator[data-state="complete"] {
border-color: #009dfd;
background: light-dark(#f1f5f9, #ffffff14);
color: light-dark(#006ce9, #4cb8ff);
}
.steps-default-separator {
flex: 1;
height: 2px;
margin: 0 0.75rem;
background: light-dark(#e2e8f0, #ffffff1f);
}
.steps-default-separator[data-state="complete"] {
background: #009dfd;
}
.steps-default-content {
margin-top: 1rem;
padding: 1rem;
border: 1px solid light-dark(#cbd5e1, #ffffff3d);
border-radius: 6px;
background: light-dark(#ffffff, #1b2045);
font-size: 0.875rem;
line-height: 1.5;
color: light-dark(#475569, #c9ddf0);
}
.steps-default-actions {
display: flex;
justify-content: flex-end;
gap: 0.5rem;
margin-top: 0.75rem;
}
.steps-default-nav {
padding: 0.375rem 0.75rem;
border: 1px solid light-dark(#cbd5e1, #ffffff3d);
border-radius: 6px;
background: light-dark(#ffffff, #1b2045);
color: light-dark(#0f172a, #ffffff);
font-family: inherit;
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
}
.steps-default-nav:hover:not([data-disabled]) {
background: light-dark(#f1f5f9, #ffffff14);
}
.steps-default-nav[data-disabled] {
opacity: 0.5;
cursor: not-allowed;
}インストール#
個別のパッケージをインストールするか、@leve-ui/coreを使用してすべてのコンポーネントをまとめて取得します。
pnpm add @leve-ui/stepsnpm install @leve-ui/stepsyarn add @leve-ui/stepsbun add @leve-ui/stepspnpm add @leve-ui/corenpm install @leve-ui/coreyarn add @leve-ui/corebun add @leve-ui/core構造#
import { Steps } from '@leve-ui/steps'; // or '@leve-ui/core'
<Steps.Root count={3}>
<Steps.List>
<Steps.Item index={0}>
<Steps.Trigger>
<Steps.Indicator>1</Steps.Indicator>
<span>Account</span>
</Steps.Trigger>
<Steps.Separator />
</Steps.Item>
</Steps.List>
<Steps.Content index={0}>Step content</Steps.Content>
<Steps.PrevTrigger>Previous</Steps.PrevTrigger>
<Steps.NextTrigger>Next</Steps.NextTrigger>
</Steps.Root>
| パーツ | 要素 | 説明 |
|---|---|---|
Steps.Root | <div> | パーツをラップし、アクティブなステップ、合計ステップ数、linearモード、および向きを管理します。 |
Steps.List | <ol> | ステップアイテム用の順序付きリストコンテナです。 |
Steps.Item | <li> | indexの位置にある単一のステップを表し、アクティブなときにaria-current="step"を設定します。 |
Steps.Trigger | <button> | クリックすると親のステップをアクティブにします。linearモードまたはアイテムのdisabledによってブロックされている場合は自動的に無効になります。 |
Steps.Indicator | <span> | 支援技術からは非表示になる、装飾用の視覚的バッジ(ステップ番号やアイコンなど)です。 |
Steps.Separator | <div> | 支援技術からは非表示になる、ステップアイテム内の装飾用の接続線です。 |
Steps.Content | <div> | 指定されたindexに対応するコンテンツパネルです。常にレンダリングされ、非アクティブな場合はhiddenが適用されます。 |
Steps.PrevTrigger | <button> | 前のステップに移動します。最初のステップでは自動的に無効になります。 |
Steps.NextTrigger | <button> | 次のステップに移動します。最後のステップでは自動的に無効になります。 |
使用例#
リニア#
Steps.Rootにlinearを渡すと、Steps.Triggerを使って後続のステップへスキップできなくなりますが、完了済みのステップに戻ることは引き続き可能です。
import { component$, useStyles$ } from '@builder.io/qwik';
import { Steps } from '@leve-ui/steps';
import styles from './linear.css?inline';
export default component$(() => {
useStyles$(styles);
return (
<Steps.Root count={3} linear class="steps-linear">
<Steps.List class="steps-linear-list">
<Steps.Item index={0} class="steps-linear-item">
<Steps.Trigger class="steps-linear-trigger">
<Steps.Indicator class="steps-linear-indicator">1</Steps.Indicator>
<span>Shipping</span>
</Steps.Trigger>
<Steps.Separator class="steps-linear-separator" />
</Steps.Item>
<Steps.Item index={1} class="steps-linear-item">
<Steps.Trigger class="steps-linear-trigger">
<Steps.Indicator class="steps-linear-indicator">2</Steps.Indicator>
<span>Payment</span>
</Steps.Trigger>
<Steps.Separator class="steps-linear-separator" />
</Steps.Item>
<Steps.Item index={2} class="steps-linear-item">
<Steps.Trigger class="steps-linear-trigger">
<Steps.Indicator class="steps-linear-indicator">3</Steps.Indicator>
<span>Confirmation</span>
</Steps.Trigger>
</Steps.Item>
</Steps.List>
<Steps.Content index={0} class="steps-linear-content">
Choose your shipping address and delivery speed.
</Steps.Content>
<Steps.Content index={1} class="steps-linear-content">
Enter your payment method and billing details.
</Steps.Content>
<Steps.Content index={2} class="steps-linear-content">
Review your order details and place your order.
</Steps.Content>
<div class="steps-linear-actions">
<Steps.PrevTrigger class="steps-linear-nav">Previous</Steps.PrevTrigger>
<Steps.NextTrigger class="steps-linear-nav">Next</Steps.NextTrigger>
</div>
</Steps.Root>
);
});.steps-linear {
width: 440px;
max-width: 100%;
font-family: inherit;
color: light-dark(#0f172a, #ffffff);
}
.steps-linear-list {
display: flex;
align-items: center;
list-style: none;
margin: 0;
padding: 0;
}
.steps-linear-item {
display: flex;
align-items: center;
flex: 1;
}
.steps-linear-item:last-child {
flex: none;
}
.steps-linear-trigger {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.25rem 0.375rem;
border: none;
border-radius: 6px;
background: transparent;
color: light-dark(#475569, #c9ddf0);
font-family: inherit;
font-size: 0.875rem;
font-weight: 500;
white-space: nowrap;
cursor: pointer;
}
.steps-linear-trigger[data-state="current"],
.steps-linear-trigger[data-state="complete"] {
color: light-dark(#0f172a, #ffffff);
}
.steps-linear-trigger:hover:not([data-disabled]) {
background: light-dark(#f1f5f9, #ffffff14);
}
.steps-linear-trigger:focus-visible,
.steps-linear-nav:focus-visible {
outline: 2px solid #009dfd;
outline-offset: 2px;
}
/* Upcoming triggers are disabled in linear mode */
.steps-linear-trigger[data-disabled],
.steps-linear-nav[data-disabled] {
opacity: 0.5;
cursor: not-allowed;
}
.steps-linear-indicator {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.75rem;
height: 1.75rem;
border-radius: 9999px;
border: 1px solid light-dark(#cbd5e1, #ffffff3d);
background: light-dark(#ffffff, #1b2045);
color: light-dark(#475569, #c9ddf0);
font-size: 0.75rem;
font-weight: 600;
flex-shrink: 0;
}
.steps-linear-indicator[data-state="current"] {
border-color: #009dfd;
background: #009dfd;
color: #ffffff;
}
.steps-linear-indicator[data-state="complete"] {
border-color: #009dfd;
background: light-dark(#f1f5f9, #ffffff14);
color: light-dark(#006ce9, #4cb8ff);
}
.steps-linear-separator {
flex: 1;
height: 2px;
margin: 0 0.75rem;
background: light-dark(#e2e8f0, #ffffff1f);
}
.steps-linear-separator[data-state="complete"] {
background: #009dfd;
}
.steps-linear-content {
margin-top: 1rem;
padding: 1rem;
border: 1px solid light-dark(#cbd5e1, #ffffff3d);
border-radius: 6px;
background: light-dark(#ffffff, #1b2045);
font-size: 0.875rem;
line-height: 1.5;
color: light-dark(#475569, #c9ddf0);
}
.steps-linear-actions {
display: flex;
justify-content: flex-end;
gap: 0.5rem;
margin-top: 0.75rem;
}
.steps-linear-nav {
padding: 0.375rem 0.75rem;
border: 1px solid light-dark(#cbd5e1, #ffffff3d);
border-radius: 6px;
background: light-dark(#ffffff, #1b2045);
color: light-dark(#0f172a, #ffffff);
font-family: inherit;
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
}
.steps-linear-nav:hover:not([data-disabled]) {
background: light-dark(#f1f5f9, #ffffff14);
}垂直方向#
Steps.Rootにorientation="vertical"を渡すと、ステップが垂直に配置され、リスト、アイテム、セパレーターの各パーツにdata-orientation="vertical"が伝播されます。
import { component$, useStyles$ } from '@builder.io/qwik';
import { Steps } from '@leve-ui/steps';
import styles from './vertical.css?inline';
export default component$(() => {
useStyles$(styles);
return (
<Steps.Root count={3} orientation="vertical" class="steps-vertical">
<Steps.List class="steps-vertical-list">
<Steps.Item index={0} class="steps-vertical-item">
<Steps.Trigger class="steps-vertical-trigger">
<Steps.Indicator class="steps-vertical-indicator">1</Steps.Indicator>
<span>Order Placed</span>
</Steps.Trigger>
<Steps.Separator class="steps-vertical-separator" />
</Steps.Item>
<Steps.Item index={1} class="steps-vertical-item">
<Steps.Trigger class="steps-vertical-trigger">
<Steps.Indicator class="steps-vertical-indicator">2</Steps.Indicator>
<span>In Transit</span>
</Steps.Trigger>
<Steps.Separator class="steps-vertical-separator" />
</Steps.Item>
<Steps.Item index={2} class="steps-vertical-item">
<Steps.Trigger class="steps-vertical-trigger">
<Steps.Indicator class="steps-vertical-indicator">3</Steps.Indicator>
<span>Delivered</span>
</Steps.Trigger>
</Steps.Item>
</Steps.List>
<div class="steps-vertical-panel">
<Steps.Content index={0} class="steps-vertical-content">
Your order has been received and is being prepared.
</Steps.Content>
<Steps.Content index={1} class="steps-vertical-content">
Your package is on the way to your destination.
</Steps.Content>
<Steps.Content index={2} class="steps-vertical-content">
Your package has arrived at the delivery address.
</Steps.Content>
<div class="steps-vertical-actions">
<Steps.PrevTrigger class="steps-vertical-nav">Previous</Steps.PrevTrigger>
<Steps.NextTrigger class="steps-vertical-nav">Next</Steps.NextTrigger>
</div>
</div>
</Steps.Root>
);
});.steps-vertical {
display: flex;
gap: 1.5rem;
width: 440px;
max-width: 100%;
font-family: inherit;
color: light-dark(#0f172a, #ffffff);
}
.steps-vertical-list {
display: flex;
flex-direction: column;
list-style: none;
margin: 0;
padding: 0;
flex-shrink: 0;
}
.steps-vertical-item {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.steps-vertical-trigger {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.25rem 0.375rem;
border: none;
border-radius: 6px;
background: transparent;
color: light-dark(#475569, #c9ddf0);
font-family: inherit;
font-size: 0.875rem;
font-weight: 500;
white-space: nowrap;
cursor: pointer;
}
.steps-vertical-trigger[data-state="current"],
.steps-vertical-trigger[data-state="complete"] {
color: light-dark(#0f172a, #ffffff);
}
.steps-vertical-trigger:hover:not([data-disabled]) {
background: light-dark(#f1f5f9, #ffffff14);
}
.steps-vertical-trigger:focus-visible,
.steps-vertical-nav:focus-visible {
outline: 2px solid #009dfd;
outline-offset: 2px;
}
.steps-vertical-indicator {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.75rem;
height: 1.75rem;
border-radius: 9999px;
border: 1px solid light-dark(#cbd5e1, #ffffff3d);
background: light-dark(#ffffff, #1b2045);
color: light-dark(#475569, #c9ddf0);
font-size: 0.75rem;
font-weight: 600;
flex-shrink: 0;
}
.steps-vertical-indicator[data-state="current"] {
border-color: #009dfd;
background: #009dfd;
color: #ffffff;
}
.steps-vertical-indicator[data-state="complete"] {
border-color: #009dfd;
background: light-dark(#f1f5f9, #ffffff14);
color: light-dark(#006ce9, #4cb8ff);
}
/* Vertical connector line centered beneath the 1.75rem indicator */
.steps-vertical-separator[data-orientation="vertical"] {
width: 2px;
height: 1.5rem;
margin: 0.25rem 0 0.25rem 1.25rem;
background: light-dark(#e2e8f0, #ffffff1f);
}
.steps-vertical-separator[data-state="complete"] {
background: #009dfd;
}
.steps-vertical-panel {
display: flex;
flex: 1;
flex-direction: column;
justify-content: space-between;
gap: 0.75rem;
}
.steps-vertical-content {
padding: 1rem;
border: 1px solid light-dark(#cbd5e1, #ffffff3d);
border-radius: 6px;
background: light-dark(#ffffff, #1b2045);
font-size: 0.875rem;
line-height: 1.5;
color: light-dark(#475569, #c9ddf0);
}
.steps-vertical-actions {
display: flex;
justify-content: flex-end;
gap: 0.5rem;
}
.steps-vertical-nav {
padding: 0.375rem 0.75rem;
border: 1px solid light-dark(#cbd5e1, #ffffff3d);
border-radius: 6px;
background: light-dark(#ffffff, #1b2045);
color: light-dark(#0f172a, #ffffff);
font-family: inherit;
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
}
.steps-vertical-nav:hover:not([data-disabled]) {
background: light-dark(#f1f5f9, #ffffff14);
}
.steps-vertical-nav[data-disabled] {
opacity: 0.5;
cursor: not-allowed;
}状態制御#
bind:stepでSignal<number>をバインドすると、外部からアクティブな0始まりのステップインデックスを読み取りおよび更新できます。
import { component$, useSignal, useStyles$ } from '@builder.io/qwik';
import { Steps } from '@leve-ui/steps';
import { LuCheck } from '@qwikest/icons/lucide';
import styles from './controlled.css?inline';
const items = [
{ label: 'Plan', description: 'Select a monthly or annual subscription plan.' },
{ label: 'Add-ons', description: 'Customize extra storage and priority support.' },
{ label: 'Summary', description: 'Confirm your plan and complete checkout.' },
];
export default component$(() => {
useStyles$(styles);
const step = useSignal(1);
return (
<div class="steps-controlled-wrapper">
<div class="steps-controlled-toolbar">
<p class="steps-controlled-status">
Step {step.value + 1} of {items.length}
</p>
<button
type="button"
class="steps-controlled-reset"
onClick$={() => {
step.value = 0;
}}
>
Reset
</button>
</div>
<Steps.Root count={items.length} bind:step={step} class="steps-controlled">
<Steps.List class="steps-controlled-list">
{items.map((item, index) => (
<Steps.Item key={item.label} index={index} class="steps-controlled-item">
<Steps.Trigger class="steps-controlled-trigger">
<Steps.Indicator class="steps-controlled-indicator">
{step.value > index ? (
<LuCheck class="steps-controlled-check" aria-hidden="true" />
) : (
index + 1
)}
</Steps.Indicator>
<span>{item.label}</span>
</Steps.Trigger>
{index < items.length - 1 && <Steps.Separator class="steps-controlled-separator" />}
</Steps.Item>
))}
</Steps.List>
{items.map((item, index) => (
<Steps.Content key={item.label} index={index} class="steps-controlled-content">
{item.description}
</Steps.Content>
))}
<div class="steps-controlled-actions">
<Steps.PrevTrigger class="steps-controlled-nav">Previous</Steps.PrevTrigger>
<Steps.NextTrigger class="steps-controlled-nav">Next</Steps.NextTrigger>
</div>
</Steps.Root>
</div>
);
});.steps-controlled-wrapper {
display: flex;
flex-direction: column;
gap: 0.75rem;
width: 440px;
max-width: 100%;
font-family: inherit;
color: light-dark(#0f172a, #ffffff);
}
.steps-controlled-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
}
.steps-controlled-status {
margin: 0;
font-size: 0.875rem;
color: light-dark(#475569, #c9ddf0);
}
.steps-controlled-reset,
.steps-controlled-nav {
padding: 0.375rem 0.75rem;
border: 1px solid light-dark(#cbd5e1, #ffffff3d);
border-radius: 6px;
background: light-dark(#ffffff, #1b2045);
color: light-dark(#0f172a, #ffffff);
font-family: inherit;
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
}
.steps-controlled-reset:hover,
.steps-controlled-nav:hover:not([data-disabled]) {
background: light-dark(#f1f5f9, #ffffff14);
}
.steps-controlled-list {
display: flex;
align-items: center;
list-style: none;
margin: 0;
padding: 0;
}
.steps-controlled-item {
display: flex;
align-items: center;
flex: 1;
}
.steps-controlled-item:last-child {
flex: none;
}
.steps-controlled-trigger {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.25rem 0.375rem;
border: none;
border-radius: 6px;
background: transparent;
color: light-dark(#475569, #c9ddf0);
font-family: inherit;
font-size: 0.875rem;
font-weight: 500;
white-space: nowrap;
cursor: pointer;
}
.steps-controlled-trigger[data-state="current"],
.steps-controlled-trigger[data-state="complete"] {
color: light-dark(#0f172a, #ffffff);
}
.steps-controlled-trigger:hover:not([data-disabled]) {
background: light-dark(#f1f5f9, #ffffff14);
}
.steps-controlled-trigger:focus-visible,
.steps-controlled-reset:focus-visible,
.steps-controlled-nav:focus-visible {
outline: 2px solid #009dfd;
outline-offset: 2px;
}
.steps-controlled-indicator {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.75rem;
height: 1.75rem;
border-radius: 9999px;
border: 1px solid light-dark(#cbd5e1, #ffffff3d);
background: light-dark(#ffffff, #1b2045);
color: light-dark(#475569, #c9ddf0);
font-size: 0.75rem;
font-weight: 600;
flex-shrink: 0;
}
.steps-controlled-indicator[data-state="current"] {
border-color: #009dfd;
background: #009dfd;
color: #ffffff;
}
.steps-controlled-indicator[data-state="complete"] {
border-color: light-dark(#16a34a, #4ade80);
background: light-dark(#16a34a, #4ade80);
color: #ffffff;
}
.steps-controlled-check {
width: 0.875rem;
height: 0.875rem;
}
.steps-controlled-separator {
flex: 1;
height: 2px;
margin: 0 0.75rem;
background: light-dark(#e2e8f0, #ffffff1f);
}
.steps-controlled-separator[data-state="complete"] {
background: light-dark(#16a34a, #4ade80);
}
.steps-controlled-content {
margin-top: 1rem;
padding: 1rem;
border: 1px solid light-dark(#cbd5e1, #ffffff3d);
border-radius: 6px;
background: light-dark(#ffffff, #1b2045);
font-size: 0.875rem;
line-height: 1.5;
color: light-dark(#475569, #c9ddf0);
}
.steps-controlled-actions {
display: flex;
justify-content: flex-end;
gap: 0.5rem;
margin-top: 0.75rem;
}
.steps-controlled-nav[data-disabled] {
opacity: 0.5;
cursor: not-allowed;
}APIリファレンス#
Root#
| Prop | デフォルト | 型 |
|---|---|---|
| count (必須) | – | number ステップの合計数です。アクティブなステップの範囲制限や、最後のステップで |
| defaultStep | 0 | number 非制御時の初期0始まりステップインデックスです。 |
| bind:step | – | Signal<number> 現在の0始まりステップインデックスを保持するシグナル(制御時)です。 |
| onStepChange$ | – | QRL<(step: number) => void> アクティブなステップが変更されたときに呼び出されます。 |
| linear | false | boolean
|
| orientation | 'horizontal' | 'horizontal' | 'vertical' ステップリストのレイアウトの向きです。 |
<div>のすべての属性も受け付けます。
| データ属性 | 値 |
|---|---|
data-leve-steps | 常に存在 |
data-orientation | "horizontal" | "vertical" |
List#
独自のpropsはありません。 <ol>のすべての属性を受け付けます。
| データ属性 | 値 |
|---|---|
data-leve-steps-list | 常に存在 |
data-orientation | "horizontal" | "vertical" |
Item#
| Prop | デフォルト | 型 |
|---|---|---|
| index (必須) | – | number このステップアイテムの0始まりのインデックスです。 |
| disabled | false | boolean このステップアイテムとそのトリガーを無効にします。 |
<li>のすべての属性も受け付けます。
| データ属性 | 値 |
|---|---|
data-leve-steps-item | 常に存在 |
data-state | "complete" | "current" | "upcoming" |
data-disabled | disabledがtrueのときに付与されます |
data-orientation | "horizontal" | "vertical" |
Trigger#
独自のpropsはありません。 <button>のすべての属性を受け付けます。
| データ属性 | 値 |
|---|---|
data-leve-steps-trigger | 常に存在 |
data-state | "complete" | "current" | "upcoming" |
data-disabled | アイテムが無効な場合、トリガーが無効な場合、またはlinearが後続のステップをブロックしている場合に付与されます。 |
Indicator#
独自のpropsはありません。 <span>のすべての属性を受け付けます。
| データ属性 | 値 |
|---|---|
data-leve-steps-indicator | 常に存在 |
data-state | "complete" | "current" | "upcoming" |
Separator#
独自のpropsはありません。 <div>のすべての属性を受け付けます。
| データ属性 | 値 |
|---|---|
data-leve-steps-separator | 常に存在 |
data-state | "complete" | "current" | "upcoming" |
data-orientation | "horizontal" | "vertical" |
Content#
| Prop | デフォルト | 型 |
|---|---|---|
| index (必須) | – | number このコンテンツパネルが属するステップの0始まりのインデックスです。 |
<div>のすべての属性も受け付けます。
| データ属性 | 値 |
|---|---|
data-leve-steps-content | 常に存在 |
data-state | "open" | "closed" |
PrevTrigger#
独自のpropsはありません。 <button>のすべての属性を受け付けます。
| データ属性 | 値 |
|---|---|
data-leve-steps-prev-trigger | 常に存在 |
data-disabled | 最初のステップである場合、またはdisabledがtrueの場合に付与されます。 |
NextTrigger#
独自のpropsはありません。 <button>のすべての属性を受け付けます。
| データ属性 | 値 |
|---|---|
data-leve-steps-next-trigger | 常に存在 |
data-disabled | 最後のステップである場合、またはdisabledがtrueの場合に付与されます。 |
アクセシビリティ#
Steps.Listはセマンティックな<ol>をレンダリングし、各Steps.Itemは<li>をレンダリングします。- アクティブな
Steps.Itemにはaria-current="step"が付与されます。 Steps.IndicatorおよびSteps.Separatorはaria-hidden="true"をレンダリングするため、スクリーンリーダーは装飾用の番号、アイコン、接続線をスキップします。Steps.Trigger、Steps.PrevTrigger、およびSteps.NextTriggerはネイティブの<button type="button">要素であり、非アクティブ時やlinearモードでブロックされている場合はネイティブのdisabled属性を使用します。
キーボード操作#
| キー | 説明 |
|---|---|
Tab / Shift+Tab | 有効なステップトリガーとナビゲーションボタンの間でフォーカスを移動します。 |
Enter / Space | フォーカスされているトリガーまたはナビゲーションボタンをアクティブにします。 |