- Completed:Install the desktop app
Skip this if you already have it.
- Completed:Connect your workspace
In the app, open Settings → Workspaces and sign in to Stark Industries.
- Completed:Invite your team
Teammates you invite can open every project in Stark Industries.
import { ChevronDownIcon, DownloadIcon, UserPlusIcon } from "lucide-react";
import { Button, ButtonGroup, ButtonGroupSeparator } from "@/components/ui/button";import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger,} from "@/components/ui/dropdown-menu";import { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperTitle,} from "@/components/ui/stepper";
export default function StepperVertical() { return ( <Stepper className="w-full max-w-md"> <StepperItem status="complete"> <StepperIndicator /> <StepperContent> <StepperTitle>Install the desktop app</StepperTitle> <StepperDescription>Skip this if you already have it.</StepperDescription> <ButtonGroup> <Button> <DownloadIcon data-icon="inline-start" /> Download for macOS </Button> <ButtonGroupSeparator /> <DropdownMenu> <DropdownMenuTrigger render={<Button size="icon" aria-label="Other platforms" />}> <ChevronDownIcon /> </DropdownMenuTrigger> <DropdownMenuContent align="end"> <DropdownMenuItem>Windows</DropdownMenuItem> <DropdownMenuItem>Linux (.deb)</DropdownMenuItem> <DropdownMenuItem>Linux (.rpm)</DropdownMenuItem> </DropdownMenuContent> </DropdownMenu> </ButtonGroup> </StepperContent> </StepperItem> <StepperItem status="current"> <StepperIndicator /> <StepperContent> <StepperTitle>Connect your workspace</StepperTitle> <StepperDescription> In the app, open <strong>Settings → Workspaces</strong> and sign in to{" "} <strong>Stark Industries</strong>. </StepperDescription> </StepperContent> </StepperItem> <StepperItem> <StepperIndicator /> <StepperContent> <StepperTitle>Invite your team</StepperTitle> <StepperDescription> Teammates you invite can open every project in Stark Industries. </StepperDescription> <Button> <UserPlusIcon data-icon="inline-start" /> Invite members </Button> </StepperContent> </StepperItem> </Stepper> );}- Completed:Add the registryOnce per project
pnpm dlx shadcn@latest registry add @jarvis=https://ui.jarv.is/r/{name}.json - Completed:Add stepper
pnpm dlx shadcn@latest add @jarvis/stepper
Usage
import { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperTitle,} from "@/components/ui/stepper";
export function SetupSteps() { return ( <Stepper> <StepperItem status="complete"> <StepperIndicator /> <StepperContent> <StepperTitle>Create an account</StepperTitle> <StepperDescription>You're signed in as tony@example.com.</StepperDescription> </StepperContent> </StepperItem> <StepperItem status="current"> <StepperIndicator /> <StepperContent> <StepperTitle>Connect your workspace</StepperTitle> </StepperContent> </StepperItem> </Stepper> );}Set each item's status to upcoming, current or complete from your own state.
StepperContent can hold anything, such as a step's buttons.
Composition
Examples
Horizontal
orientation="horizontal" puts the steps in a row. Keep titles short, since long ones are
truncated.
- Completed:Install
Desktop app
- Completed:Connect
Workspace
- Completed:Invite
Your team
import * as React from "react";
import { Button } from "@/components/ui/button";import { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperTitle,} from "@/components/ui/stepper";
const steps = [ { title: "Install", description: "Desktop app" }, { title: "Connect", description: "Workspace" }, { title: "Invite", description: "Your team" },];
export default function StepperHorizontal() { const [done, setDone] = React.useState(1);
return ( <div className="flex w-full max-w-xl flex-col gap-6"> <Stepper orientation="horizontal"> {steps.map((step, index) => ( <StepperItem key={step.title} status={index < done ? "complete" : index === done ? "current" : "upcoming"} > <StepperIndicator /> <StepperContent> <StepperTitle>{step.title}</StepperTitle> <StepperDescription>{step.description}</StepperDescription> </StepperContent> </StepperItem> ))} </Stepper> <div className="flex gap-2"> <Button variant="primary" size="sm" disabled={done === steps.length} focusableWhenDisabled onClick={() => setDone(done + 1)} > Complete current step </Button> <Button variant="ghost" size="sm" disabled={done === 0} focusableWhenDisabled onClick={() => setDone(0)} > Reset </Button> </div> </div> );}Custom indicator
Children of StepperIndicator replace the number and the check, including the visually hidden
"Completed:" text for screen readers, so add your own. To change only that text and keep the check,
pass completedLabel.
- Completed:Payment received
March 3, 9:14 AM
- Packing your order
Usually ships within a day.
- Out for delivery
We'll email you a tracking link.
import { CreditCardIcon, PackageIcon, TruckIcon } from "lucide-react";
import { Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperTitle,} from "@/components/ui/stepper";
export default function StepperCustomIndicator() { return ( <Stepper className="w-full max-w-sm"> <StepperItem status="complete"> <StepperIndicator> <CreditCardIcon className="size-3" /> <span className="sr-only">Completed:</span> </StepperIndicator> <StepperContent> <StepperTitle>Payment received</StepperTitle> <StepperDescription>March 3, 9:14 AM</StepperDescription> </StepperContent> </StepperItem> <StepperItem status="current"> <StepperIndicator> <PackageIcon className="size-3" /> </StepperIndicator> <StepperContent> <StepperTitle>Packing your order</StepperTitle> <StepperDescription>Usually ships within a day.</StepperDescription> </StepperContent> </StepperItem> <StepperItem> <StepperIndicator> <TruckIcon className="size-3" /> </StepperIndicator> <StepperContent> <StepperTitle>Out for delivery</StepperTitle> <StepperDescription>We'll email you a tracking link.</StepperDescription> </StepperContent> </StepperItem> </Stepper> );}Props
| Part | Extends |
|---|---|
| Stepper | <ol> |
| StepperItem | <li> |
| StepperIndicator | <div> |
| StepperContent | <div> |
| StepperTitle | <div> |
| StepperDescription | <p> |
Base UI's styling (opens in a new tab) and composition (opens in a new tab) guides say more about className, style and render.
Stepper
| Prop | Type | Default |
|---|---|---|
orientation
| "horizontal" | "vertical" | "vertical" |
classNameCSS class applied to the element. | string | — |
styleStyle applied to the element. | React.CSSProperties | — |
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a | ComponentRenderFn<HTMLProps, {}> | React.ReactElement | — |
StepperItem
| Prop | Type | Default |
|---|---|---|
statusWhether the step is done, the one in progress, or still to come. Sets the indicator and | "complete" | "current" | "upcoming" | "upcoming" |
classNameCSS class applied to the element. | string | — |
styleStyle applied to the element. | React.CSSProperties | — |
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a | ComponentRenderFn<HTMLProps, {}> | React.ReactElement | — |
StepperIndicator
| Prop | Type | Default |
|---|---|---|
completedLabelWhat screen readers announce before a completed step's title, beside its check. | string | "Completed:" |
classNameCSS class applied to the element. | string | — |
styleStyle applied to the element. | React.CSSProperties | — |
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a | ComponentRenderFn<HTMLProps, {}> | React.ReactElement | — |
StepperContent
| Prop | Type | Default |
|---|---|---|
classNameCSS class applied to the element. | string | — |
styleStyle applied to the element. | React.CSSProperties | — |
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a | ComponentRenderFn<HTMLProps, {}> | React.ReactElement | — |
StepperTitle
| Prop | Type | Default |
|---|---|---|
classNameCSS class applied to the element. | string | — |
styleStyle applied to the element. | React.CSSProperties | — |
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a | ComponentRenderFn<HTMLProps, {}> | React.ReactElement | — |
StepperDescription
| Prop | Type | Default |
|---|---|---|
classNameCSS class applied to the element. | string | — |
styleStyle applied to the element. | React.CSSProperties | — |
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a | ComponentRenderFn<HTMLProps, {}> | React.ReactElement | — |