# Progressive steps

A hierarchical display of information to inform users of the tasks being performed.

## Building blocks

A B C D E
#### A. Header - optional

When displaying a list of steps, the header should succinctly describe the main step or workflow. In a chat interface, a header may not be necessary as the context is established through the conversation.

#### B. Main steps

Display status related to individual steps or actions being performed as steps using the [steps](/components/steps/index.html.md) component.

#### C. Sub-steps - optional

If the main step has sub-steps, display them in a [tree view](/components/tree-view/index.html.md) leveraging the [status indicators](/components/status-indicator/index.html.md) component.

#### D. Status hub - optional

If there is more than one status within sub-steps, display a status hub to the right of the step. The status hub uses the [status indicator](/components/status-indicator/index.html.md) component.

#### E. Step details - optional

Step details can be indicated via popover or description text. Use a [popover](/components/popover/index.html.md) to provide supplemental information about the step. Use description text to display details that are necessary for the user's context. For example, estimated completion time for a step, or additional details about a step status.

## Key UX concepts

#### Progressive steps

A step is a unit of work the assistant performs to answer a request, such as querying a data source or provisioning a resource. Status is the state of a step while the request is being answered: [not-started](/components/status-indicator/index.html.md) , [in progress](/components/status-indicator/index.html.md) , [success](/components/status-indicator/index.html.md) , [error](/components/status-indicator/index.html.md) , or [stopped](/components/status-indicator/index.html.md) . Showing both tells users what the assistant is doing while it works, and what it did once it stops.

#### Step types

- **Sequential steps **   advance in a fixed order, where each step consumes the output of the step before it, shown with [steps](/components/steps/index.html.md)   . For example, an investigation that reads a request, then scans stack templates, then queries deployment history using what the scan found.
- **Non-sequential steps **   run at the same time, where no step waits on another, shown with a [list](/components/list/index.html.md)   . For example, querying the same metric across four regions at once.

A step can contain sub-steps, and the same dependency question applies inside the group. For substeps, see [tree view](/components/tree-view/index.html.md)

### Provide transparency

Provide clear and informative [status indicator](/components/status-indicator/index.html.md) updates throughout the process to maintain user transparency and trust. This helps users understand what the system is doing and builds confidence in the generative AI capabilities.

### Enhance trust and confidence

Clear and contextual error or warning messages help users understand any issues that arise during the process, and enable them to take follow-up actions. This transparency helps build trust in the generative AI system's capabilities.

### Balance transparency and cognitive load

Status updates and loading indicators should be kept concise and unobtrusive. Provide users the ability to view more details about steps within the process through the use of popovers, links, or expandable sections. This allows users to control the level of information they receive.

### Enhance trust and confidence

Clear and contextual status and warning messages help users understand any issues that arise during the process, and enable them to take follow-up actions. Status updates and loading indicators should be kept concise and unobtrusive, with more details about each step available through popovers, links, or expandable sections. This allows users to control the level of information they receive, and helps build trust in the generative AI system's capabilities. When a step requires information from the user before it can continue, collect it within the conversation by following the guidelines for [in-flow user input](/gen-ai/patterns/in-flow-user-input/index.html.md).

## States

### Loading periods

Generative AI can vary in response times. The step status experience should adjust the loading states and indicators based on the expected latency, providing different visual cues for loading experiences above and below 10 seconds.

#### Under 10 seconds

**Default: ** Display a loading status on the last [step](/components/steps/index.html.md) . Avoid displaying a loading state for under one second as this can seem jarring to users and can cause flickering in the UI.

1. Evaluated
2. Checked 5 nodes
3. Checking EKS clusters

```steps-loading.tsx
import React from 'react';
import Steps from '@cloudscape-design/components/steps';
import Container from '@cloudscape-design/components/container';

export default function Loading() {
  return (
    <Container>
      <Steps
        ariaLabel="Recommendation progress"
        steps={[
          { status: 'success', statusIconAriaLabel: 'Success', header: 'Evaluated' },
          { status: 'success', statusIconAriaLabel: 'Success', header: 'Checked 5 nodes' },
          { status: 'loading', statusIconAriaLabel: 'Loading', header: 'Checking EKS clusters' },
        ]}
      />
    </Container>
  );
}
```

**Sub-steps: ** Display sub-steps with corresponding status to inform users of the overall progress when applicable. For example, display a list of nodes being checked when troubleshooting an EKS issue.

- Evaluated
- Checking node 3 of 3   1   2
  - node-17     ( [eksclu-node-12345](about:blank/index.html.md)     )
  - node-18     ( [eksclu-node-09876](about:blank/index.html.md)     )
  - node-19     ( [eksclu-node-ab123](about:blank/index.html.md)     )

```steps-loading-with-sub-steps.tsx
import React from 'react';
import Link from '@cloudscape-design/components/link';
import Container from '@cloudscape-design/components/container';
import TreeView from '@cloudscape-design/components/tree-view';
import StatusIndicator, { StatusIndicatorProps } from '@cloudscape-design/components/status-indicator';
import SpaceBetween from '@cloudscape-design/components/space-between';
import Divider from '@cloudscape-design/components/divider';

interface Item {
  id: string;
  label: string;
  resourceId?: string;
  type: StatusIndicatorProps.Type;
  hasActions?: boolean;
  statusCounts?: { type: StatusIndicatorProps.Type; count: number }[];
  children?: Item[];
}

export default function LoadingWithSubSteps() {
  const [expandedItems, setExpandedItems] = React.useState(['2']);
  return (
    <Container>
      <TreeView<Item>
        connectorLines="vertical"
        items={[
          {
            id: '1',
            label: 'Evaluated',
            type: 'success',
            hasActions: true,
          },
          {
            id: '2',
            label: 'Checking node 3 of 3',
            type: 'in-progress',
            hasActions: true,
            statusCounts: [
              { type: 'in-progress', count: 1 },
              { type: 'success', count: 2 },
            ],

            children: [
              {
                id: '2.1',
                label: 'node-17',
                resourceId: 'eksclu-node-12345',
                type: 'success',
              },
              {
                id: '2.2',
                label: 'node-18',
                resourceId: 'eksclu-node-09876',
                type: 'success',
              },
              {
                id: '2.3',
                label: 'node-19',
                resourceId: 'eksclu-node-ab123',
                type: 'loading',
              },
            ],
          },
        ]}
        expandedItems={expandedItems}
        renderItem={item => ({
          content: (
            <SpaceBetween direction="horizontal" size="xs">
              <StatusIndicator type={item.type} iconAriaLabel={item.type}>
                {item.label}
              </StatusIndicator>
              {item.resourceId && (
                <span>
                  (
                  <Link href="#" variant="primary">
                    {item.resourceId}
                  </Link>
                  )
                </span>
              )}
              {item.statusCounts && <Divider orientation="vertical" />}
              {item.statusCounts?.map((s, i) => (
                <StatusIndicator key={i} type={s.type} iconAriaLabel={s.type}>
                  {`${s.count}`}
                </StatusIndicator>
              ))}
            </SpaceBetween>
          ),
        })}
        getItemId={item => item.id}
        getItemChildren={item => item.children}
        onItemToggle={({ detail }) =>
          setExpandedItems(prev =>
            detail.expanded ? [...prev, detail.item.id] : prev.filter(id => id !== detail.item.id)
          )
        }
        ariaLabel="Personalized recommendation steps"
      />
    </Container>
  );
}
```

#### Over 10 seconds

**Indeterminate loading state: ** Display the current step in a loading state along with an estimated wait time. This helps communicate the anticipated timeline and set appropriate user expectations.

1. Evaluated
2. Checked 5 nodes
3. Checking EKS clusters   This step may take up to 15 seconds to complete.

```steps-loading-with-details.tsx
import React from 'react';
import Steps from '@cloudscape-design/components/steps';
import Container from '@cloudscape-design/components/container';
import Box from '@cloudscape-design/components/box';

export default function LoadingWithDetails() {
  return (
    <Container>
      <Steps
        ariaLabel="Recommendation progress"
        steps={[
          { status: 'success', statusIconAriaLabel: 'Success', header: 'Evaluated' },
          { status: 'success', statusIconAriaLabel: 'Success', header: 'Checked 5 nodes' },
          {
            status: 'loading',
            statusIconAriaLabel: 'Loading',
            header: 'Checking EKS clusters',
            details: <Box variant="small">This step may take up to 15 seconds to complete.</Box>,
          },
        ]}
      />
    </Container>
  );
}
```

**Determinate loading state: ** If a wait time is determinate, display a [progress bar](/components/progress-bar/index.html.md) with the time remaining as suggested in [feedback mechanisms](/patterns/general/user-feedback/index.html.md) . This helps keep users informed about the processes unfolding over a longer period of time and builds trust.

1. Evaluated
2. Checked 5 nodes
3. Checking EKS clusters   36%   36%   Less than 20 seconds remaining

```steps-loading-with-progress-bar.tsx
import React from 'react';
import Steps from '@cloudscape-design/components/steps';
import Container from '@cloudscape-design/components/container';
import ProgressBar from '@cloudscape-design/components/progress-bar';

export default function LoadingWithProgressBar() {
  return (
    <Container>
      <Steps
        ariaLabel="Recommendation progress"
        steps={[
          { status: 'success', statusIconAriaLabel: 'Success', header: 'Evaluated' },
          { status: 'success', statusIconAriaLabel: 'Success', header: 'Checked 5 nodes' },
          {
            status: 'in-progress',
            statusIconAriaLabel: 'In progress',
            header: 'Checking EKS clusters',
            details: <ProgressBar value={36} additionalInfo="Less than 20 seconds remaining" />,
          },
        ]}
      />
    </Container>
  );
}
```

### Error

A failed step keeps the error status, and any steps that depend on it are marked stopped.

- Evaluated
- Failed to check 1 of 5 nodes   Retry   1   1   3
  - node-17     ( [eksclu-node-12345](about:blank/index.html.md)     )
  - node-18     ( [eksclu-node-09876](about:blank/index.html.md)     )
  - node-19     ( [eksclu-node-ab123](about:blank/index.html.md)     )
  - node-20     ( [eksclu-node-cd456](about:blank/index.html.md)     )
  - node-21     ( [eksclu-node-ef789](about:blank/index.html.md)     )
- Summarize findings   Skipped because checking the nodes failed.

```steps-error.tsx
import React from 'react';
import TreeView from '@cloudscape-design/components/tree-view';
import Link from '@cloudscape-design/components/link';
import Container from '@cloudscape-design/components/container';
import StatusIndicator, { StatusIndicatorProps } from '@cloudscape-design/components/status-indicator';
import SpaceBetween from '@cloudscape-design/components/space-between';
import Button from '@cloudscape-design/components/button';
import Popover from '@cloudscape-design/components/popover';
import Box from '@cloudscape-design/components/box';
import Divider from '@cloudscape-design/components/divider';

interface Item {
  id: string;
  label: string;
  resourceId?: string;
  type: StatusIndicatorProps.Type;
  details?: string;
  hasRetry?: boolean;
  statusDetails?: { header: string; content: string };
  statusCounts?: { type: StatusIndicatorProps.Type; count: number }[];
  children?: Item[];
}

export default function StepsError() {
  const [retried, setRetried] = React.useState(false);
  const [expandedItems, setExpandedItems] = React.useState(['2']);

  return (
    <Container>
      <TreeView<Item>
        connectorLines="vertical"
        items={[
          {
            id: '1',
            label: 'Evaluated',
            type: 'success',
          },
          {
            id: '2',
            label: retried ? 'Checked 5 nodes' : 'Failed to check 1 of 5 nodes',
            type: retried ? 'success' : 'error',
            hasRetry: !retried,
            statusDetails: retried
              ? undefined
              : {
                  header: 'Node check failed',
                  content:
                    'node-19 (eksclu-node-ab123) did not respond within 10 seconds. The other 4 nodes were checked successfully, so only this node needs to be retried.',
                },
            statusCounts: retried
              ? [
                  { type: 'warning', count: 1 },
                  { type: 'success', count: 4 },
                ]
              : [
                  { type: 'error', count: 1 },
                  { type: 'warning', count: 1 },
                  { type: 'success', count: 3 },
                ],
            children: [
              {
                id: '2.1',
                label: 'node-17',
                resourceId: 'eksclu-node-12345',
                type: 'success',
              },
              {
                id: '2.2',
                label: 'node-18',
                resourceId: 'eksclu-node-09876',
                type: 'warning',
                statusDetails: {
                  header: 'Disk pressure detected',
                  content:
                    'The node is reporting disk pressure at 84% of capacity. The check passed, but the node may begin evicting pods if usage keeps climbing.',
                },
              },
              {
                id: '2.3',
                label: 'node-19',
                resourceId: 'eksclu-node-ab123',
                type: retried ? 'success' : 'error',
                statusDetails: retried
                  ? undefined
                  : {
                      header: 'Node health check failed',
                      content:
                        'The node health check was unable to connect to the node at the expected API endpoint. The node appears to be unresponsive and may be offline or experiencing a software or hardware issue.',
                    },
              },
              {
                id: '2.4',
                label: 'node-20',
                resourceId: 'eksclu-node-cd456',
                type: 'success',
              },
              {
                id: '2.5',
                label: 'node-21',
                resourceId: 'eksclu-node-ef789',
                type: 'success',
              },
            ],
          },
          {
            id: '3',
            label: retried ? 'Summarizing findings' : 'Summarize findings',
            type: retried ? 'loading' : 'stopped',
            details: retried ? undefined : 'Skipped because checking the nodes failed.',
          },
        ]}
        expandedItems={expandedItems}
        renderItem={item => {
          const status = (
            <StatusIndicator type={item.type} iconAriaLabel={item.type}>
              {item.label}
            </StatusIndicator>
          );

          return {
            content: (
              <SpaceBetween direction="horizontal" size="xs">
                {item.statusDetails ? (
                  <Popover
                    header={item.statusDetails.header}
                    content={item.statusDetails.content}
                    dismissAriaLabel="Close"
                    triggerType="text"
                  >
                    {status}
                  </Popover>
                ) : (
                  status
                )}
                {item.resourceId && (
                  <span>
                    (
                    <Link href="#" variant="primary">
                      {item.resourceId}
                    </Link>
                    )
                  </span>
                )}
                {item.hasRetry && (
                  <Button variant="inline-link" onClick={() => setRetried(true)}>
                    Retry
                  </Button>
                )}
                {item.statusCounts && <Divider orientation="vertical" />}
                {item.statusCounts?.map((s, i) => (
                  <StatusIndicator key={i} type={s.type} iconAriaLabel={s.type}>
                    {s.count}
                  </StatusIndicator>
                ))}
              </SpaceBetween>
            ),
            secondaryContent: item.details && (
              <Box variant="small" color="text-body-secondary">
                {item.details}
              </Box>
            ),
          };
        }}
        getItemId={item => item.id}
        getItemChildren={item => item.children}
        onItemToggle={({ detail }) =>
          setExpandedItems(prev =>
            detail.expanded ? [...prev, detail.item.id] : prev.filter(id => id !== detail.item.id)
          )
        }
        ariaLabel="Personalized recommendation steps"
      />
    </Container>
  );
}
```

### Completed

When presenting the final output to the user, include an [expandable section](/components/expandable-section/index.html.md) detailing the steps taken to generate the output. This should be collapsed by default.

Found the cause of the latency regression [4/4]
1. Evaluated
2. Checked 5 nodes
3. Checked EKS clusters
4. Summarized output

The latency regression comes from the connection pool change in v3.8.2. Raise the maximum connections back to 50 to recover it.

```steps-completed-with-expandable-section.tsx
import React from 'react';
import Box from '@cloudscape-design/components/box';
import Container from '@cloudscape-design/components/container';
import ExpandableSection from '@cloudscape-design/components/expandable-section';
import SpaceBetween from '@cloudscape-design/components/space-between';
import Steps from '@cloudscape-design/components/steps';

export default function CompletedWithExpandableSection() {
  return (
    <Container>
      <SpaceBetween size="s">
        <ExpandableSection headerText="Found the cause of the latency regression [4/4]">
          <Steps
            ariaLabel="Investigation progress"
            steps={[
              { status: 'success', statusIconAriaLabel: 'Success', header: 'Evaluated' },
              {
                status: 'success',
                statusIconAriaLabel: 'Success',
                header: 'Checked 5 nodes',
              },
              {
                status: 'success',
                statusIconAriaLabel: 'Success',
                header: 'Checked EKS clusters',
              },
              {
                status: 'success',
                statusIconAriaLabel: 'Success',
                header: 'Summarized output',
              },
            ]}
          />
        </ExpandableSection>
        <Box variant="p">
          The latency regression comes from the connection pool change in v3.8.2. Raise the maximum connections back to
          50 to recover it.
        </Box>
      </SpaceBetween>
    </Container>
  );
}
```

## General guidelines

### Do

- **Offer more detail about each step**   Enable users to view more details about each step of the process through popovers, links, sub-steps, or expandable sections. This gives users the ability to dig deeper into the troubleshooting details
- **Change the status to pending when a sub-step is loading**   When a sub-step is loading, change the status of the main step to *pending *   to indicate that the step is in progress, and move the *loading *   status to the sub-step rather than leaving it on the main step
- **Prioritize the most urgent status**  
  The status of the main step corresponds to the most critical status in the sub-step. For example, If there is an error, warning, and success status in the sub-steps, the main step will have an error status.
- **Show the main step as pending while a sub-step loads**  
  When a sub-step is loading, set the main step to pending to indicate that it's in progress, and move the loading status to the sub-step rather than leaving it on the main step.

### Don't

- **Avoid displaying a loading state for under one second**  
  Displaying a loading state for under one second can seem jarring to users and can cause flickering in the UI. For example, If the model supports streaming and has a rapid processing stage, don't display the loading text in chat bubble, instead start streaming the response directly.
- **Don't have more than 4 levels of sub-steps**  
  Keeping the number of sub-steps limited to 4 levels or less helps maintain a manageable view for the user.

## Writing guidelines

### General writing guidelines

- Use sentence case, but continue to capitalize proper nouns and brand names correctly in context.
- Use end punctuation, except in [headers](/components/header/index.html.md)   and [buttons](/components/button/index.html.md)   . Don't use exclamation points.
- Use present-tense verbs and active voice.
- Don't use *please*   , *thank you*   , ellipsis ( *...*   ), ampersand ( *&*   ), *e.g.*   , *i.e.*   , or *etc.*   in writing.
- Avoid directional language.  

  - For example: use *previous*     not *above*     , use *following*     not *below*    .
- Use device-independent language.  

  - For example: use *choose*     or *select*     not *click*    .

### Component-specific guidelines

Header Summary

- Summarize progress in the header, matched to the kind of work.  

  - **Sequential steps:**     Use the format: *\[percentage\] · \[number\] of \[total\] steps*    

    - For example: *40% · 2 of 5 steps*
  - **Independent steps:**     Use the format: *\[number\] done · \[number\] running · \[number\] queued*    

    - For example: *3 done · 2 running · 1 queued*
- **Add a segment for failed and stopped steps only when there are any**   , in the same order every time: *done · running · queued · failed · stopped*   . Omit the zero counts rather than showing *0 failed*  

  - For example: *4 done · 1 failed · 1 stopped*
- **When a run ends without finishing, say so in the summary. **   A percentage alone reads as progress that is still happening. Append the reason:  

  - *40% · 2 of 5 steps · stopped*     , or *40% · 2 of 5 steps · failed*    .
- Don't count a stopped or failed step as done. The counts have to add up to the number of steps shown, or the summary contradicts the list underneath it.
- Don't use a step position for concurrent work. Independent steps have no step number to be on.

#### Error

- **Step error:**   When a step has an error, provide clear and concise error details along with the failed status. Offer a retry option whenever it's appropriate for the user to attempt the action again.
- **Sub-step error:**   If there is more than 1 status within a sub-steps, such as an error and warning, display the status hub to the right of the main step.
- **Error details:**   When an error or warning message has lots of details corresponding to it, provide them in a [popover](/components/popover/index.html.md)   . This will help overwhelming users with information displayed at once.
- **Independent step error: **   When a step in an independent run fails, keep the other steps running, show the failed step's error on its own row with its own retry, and don't imply the run is blocked.

#### Loading text

Follow the writing guidelines for [loading and refreshing](/patterns/general/loading-and-refreshing/index.html.md) pattern.

#### Status indicator

Follow guidelines for [status indicator](/components/status-indicator/index.html.md) component.

## Related patterns and components

### In-flow user input

Inline interactions that collect structured input or allow users to review and modify agent-generated output within a generative AI chat.

[Page](/gen-ai/patterns/in-flow-user-input/index.html.md)

### Status indicator

A status indicator communicates the state of a resource-either in its entirety or a particular facet of a resource-in a compact form that is easily embedded in a card, table, list, or header view.

[View Documentation](/components/status-indicator/index.html.md)

### Expandable section

With expandable selection, users can expand or collapse a section.

[View Documentation](/components/expandable-section/index.html.md)

### Steps

Display a list of tasks.---




36%

[View Documentation](/components/steps/index.html.md)

## Search Cloudscape