---
title: "Steps"
url: "https://sarthakmishra.com/riff-ui/components/steps"
description: "Numbered steps joined by a rail that fades out at the end. Accessible React 19 source on UI SDK, installed with the shadcn CLI."
image: "https://sarthakmishra.com/og-images/riff-ui/steps.webp"
---

[View HTML](https://sarthakmishra.com/riff-ui/components/steps) · [Site index](https://sarthakmishra.com/llms.txt)

# Steps

Numbered steps joined by a rail that fades out at the end.

## Installation

### CLI

```bash
pnpm dlx shadcn@latest add @riff/steps
```

### Manual

1. Copy the component

   Save this as `components/ui/steps.tsx`:

   ```tsx
   import type { ReactNode } from 'react';
   import './steps.css';

   /** Numbered steps joined by a rail, for setup guides and walkthroughs. */
   export function Steps({ children }: { children: ReactNode }) {
     return <ol className="riff-steps">{children}</ol>;
   }

   /** One step: its title beside the number, then any content. */
   export function Step({
     title,
     children,
   }: {
     title: ReactNode;
     children?: ReactNode;
   }) {
     return (
       <li className="riff-step">
         <p className="riff-step-title">{title}</p>
         {children && <div className="riff-step-body">{children}</div>}
       </li>
     );
   }
   ```

2. Copy its styles

   Save this beside it as `steps.css`:

   ```css
   /* Host roles first, system colours after: the component reads your theme
      when it has these properties and stays legible when it does not. Each step
      draws the rail from its number to the next, with the same gap at both
      ends; the last step's rail fades out over its final 96px. */
   @layer components {
     .riff-steps {
       --riff-step-rail: calc(-1.75rem - 0.5px);
       --riff-step-gap: 0.375rem;
       --riff-step-tint: var(
         --color-border,
         color-mix(in srgb, currentColor 15%, transparent)
       );
       counter-reset: riff-step;
       margin: 1.5em 0 1.5em 0.75rem;
       padding: 0 0 0 1.75rem;
       list-style: none;
     }
     .riff-step {
       position: relative;
       counter-increment: riff-step;
       margin: 0;
       padding: 0 0 0.75rem;
       &::before {
         content: counter(riff-step);
         position: absolute;
         top: 0;
         left: calc(var(--riff-step-rail) - 0.75rem);
         display: grid;
         width: 1.5rem;
         height: 1.5rem;
         place-items: center;
         border: 1px solid var(--riff-step-tint);
         border-radius: 999px;
         background-color: var(--color-background, Canvas);
         color: var(--color-foreground, CanvasText);
         font-size: 0.75rem;
         font-weight: 600;
         font-variant-numeric: tabular-nums;
         line-height: 1;
       }
       &::after {
         content: '';
         position: absolute;
         top: calc(1.5rem + var(--riff-step-gap));
         bottom: var(--riff-step-gap);
         left: var(--riff-step-rail);
         width: 1px;
         background-color: var(--riff-step-tint);
       }
       &:last-child {
         padding-bottom: 0;
         &::after {
           bottom: 0;
           background: linear-gradient(
             to top,
             transparent,
             var(--riff-step-tint) min(100%, 6rem)
           );
         }
       }
     }
     .riff-step-title {
       margin: 0 0 0.25rem;
       color: var(--color-foreground, CanvasText);
       font-size: 1rem;
       font-weight: 600;
       line-height: 1.5rem;
     }
     .riff-step-body {
       color: var(--color-muted-foreground, GrayText);
       & > :first-child {
         margin-top: 0;
       }
       & > :last-child {
         margin-bottom: 0;
       }
     }
     @media (max-width: 39.999rem) {
       .riff-steps {
         --riff-step-rail: calc(-1.5rem - 0.5px);
         margin-inline-start: 0.625rem;
         padding-inline-start: 1.5rem;
       }
     }
   }
   ```

## Usage

```tsx
import { Step, Steps } from '@/components/ui/steps';

<Steps>
  <Step title="Install">Run the installer.</Step>
  <Step title="Configure">Add your keys.</Step>
</Steps>;
```

Steps number themselves and the rail joins each number to the next. Put anything in a step, including code blocks. In MDX, map `Steps` and `Step` as components and write Markdown inside.

## Props

| Prop             | Type        | Default | Description          |
| ---------------- | ----------- | ------- | -------------------- |
| `Steps.children` | `ReactNode` |         | The `Step` elements. |
| `Step.title`     | `ReactNode` |         | Beside the number.   |
| `Step.children`  | `ReactNode` |         | The step’s content.  |

## Structured data

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "WebSite",
      "@id": "https://sarthakmishra.com/#website",
      "url": "https://sarthakmishra.com/",
      "name": "Sarthak Mishra",
      "publisher": {
        "@id": "https://sarthakmishra.com/#person"
      },
      "inLanguage": "en"
    },
    {
      "@type": "Person",
      "@id": "https://sarthakmishra.com/#person",
      "name": "Sarthak Mishra",
      "url": "https://sarthakmishra.com/about",
      "jobTitle": "Design Engineer",
      "image": "https://sarthakmishra.com/og-images/sarthak-mishra.webp",
      "sameAs": [
        "https://github.com/SarthakMishra",
        "https://www.linkedin.com/in/itssarthakmishra/",
        "https://x.com/MishraMishry"
      ]
    },
    {
      "@type": "WebPage",
      "@id": "https://sarthakmishra.com/riff-ui/components/steps#webpage",
      "url": "https://sarthakmishra.com/riff-ui/components/steps",
      "name": "Steps React Component - Riff UI",
      "description": "Numbered steps joined by a rail that fades out at the end. Accessible React 19 source on UI SDK, installed with the shadcn CLI.",
      "inLanguage": "en",
      "isPartOf": {
        "@id": "https://sarthakmishra.com/#website"
      },
      "about": {
        "@id": "https://sarthakmishra.com/#person"
      }
    }
  ]
}
```
