apps/eclipse/content/design-system/components/steps.mdx
import { Steps, Step } from "@prisma/eclipse";
The Steps component displays a sequence of instructions or actions with a visual timeline and numbered indicators.
import { Steps, Step } from "@prisma/eclipse";
export function GettingStarted() {
return (
<Steps>
<Step>
### Install dependencies
</Step>
<Step>
### Configure environment
</Step>
<Step>
### Start the server
</Step>
</Steps>
);
}
Steps can contain code blocks and other rich content:
<Steps> <Step> #### Create a new projectInitialize a new Next.js project with TypeScript:
```bash
npx create-next-app@latest my-app --typescript
```
Add Prisma to your project:
```bash
npm install prisma --save-dev
npx prisma init
```
Update your `schema.prisma` file with your database configuration.
Perfect for onboarding flows and tutorials:
<Steps> <Step> #### Welcome to PrismaPrisma is a next-generation ORM that makes database access easy and type-safe.
Configure your database connection in the `.env` file.
Create your data models in `schema.prisma`.
Run `npx prisma generate` to create your type-safe database client.
You're ready to start building with Prisma!
Use the checked prop to mark completed steps with a checkmark icon. This is useful for showing progress in multi-step workflows.
import { Steps, Step } from "@prisma/eclipse";
export function CompletedSteps() {
return (
<Steps>
<Step checked active>
#### Create account
Account created successfully.
</Step>
<Step active>
#### Verify email
Email verified.
</Step>
<Step checked active>
#### Complete profile
Currently filling out profile information.
</Step>
<Step>
#### Start using the app
Ready to begin after profile completion.
</Step>
</Steps>
);
}
Use the active prop to visually highlight current or completed steps. Steps without the active prop are displayed with reduced opacity and neutral colors instead of the branded accent color, making them appear inactive.
import { Steps, Step } from "@prisma/eclipse";
export function ProgressIndicator() {
return (
<Steps>
<Step active>
#### Create account
Your account has been created successfully.
</Step>
<Step active>
#### Verify email
Email verification in progress...
</Step>
<Step>
#### Complete profile
Add your personal information (upcoming).
</Step>
<Step>
#### Start using the app
Begin exploring features (upcoming).
</Step>
</Steps>
);
}
Sign up for a new account with your email.
Check your inbox and click the verification link.
Add your personal information and preferences.
You're all set! Begin exploring features.
Use the variant="vertical" prop to display steps in a traditional vertical timeline layout, perfect for detailed instructions and tutorials.
import { Steps, Step } from "@prisma/eclipse";
export function VerticalSteps() {
return (
<Steps variant="vertical">
<Step variant="vertical">
#### Install dependencies
</Step>
<Step variant="vertical">
#### Configure environment
</Step>
<Step variant="vertical">
#### Start the server
</Step>
</Steps>
);
}
children - Step components (ReactNode, required)variant - Layout variant: "horizontal" or "vertical" (default: "horizontal")children - Step content, usually a heading and description (ReactNode, required)active - Whether the step is active/current/completed (boolean, default: false)checked - Whether the step is completed, displays a checkmark (boolean, default: false)variant - Layout variant: "horizontal" or "vertical" (should match parent Steps variant)The variant prop controls the layout direction:
"horizontal" (default) - Horizontal progress indicator layout with separators between steps"vertical" - Traditional vertical timeline layout with connector linesThe checked prop replaces the step number with a checkmark (✓) icon to indicate completion. This is useful for:
The active prop visually highlights the step indicator and content to show that it's the current step, a completed step, or an important step. Steps without this prop appear dimmed to indicate they are future, optional, or not yet completed. This is useful for:
checked prop to mark completed stepsactive prop to highlight current steps or completed actionschecked and active to create clear progress indicatorsvariant prop matches between Steps and Step componentsThe Steps component is perfect for: