# Stepper

A horizontal onboarding stepper with progress animation.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).

## Installation

<TabsTrigger value="cli">Command</TabsTrigger>
<TabsTrigger value="manual">Manual</TabsTrigger>

```bash
npx shadcn@latest add @framecn/stepper
```

<Step>Copy and paste the following code into your project.</Step>

<Step>Update the import paths to match your project setup.</Step>

## Usage

```tsx
import { Stepper } from "@/components/ui/stepper";
```

```tsx
<Stepper steps={["Account", "Plan", "Done"]} activeIndex={1} />
```

## Smooth transitions

The docs preview advances through three steps — Account → Plan → Done — via `useStepperTransition`:

```tsx
import { Stepper } from "@/components/framecn/stepper";
import { useStepperTransition } from "@/components/framecn/use-stepper-transition";

const stepperStyle = useStepperTransition([
  { at: 0, index: 0 },
  { at: 50, index: 1, duration: 24 },
  { at: 110, index: 2, duration: 24 },
]);

<Stepper style={stepperStyle} steps={["Account", "Plan", "Done"]} />;
```

Start explicitly at index 0 so the timeline holds the first step before it fires. Each step ease completes in 24 frames. `style` takes precedence over `activeIndex` when both are provided.

## API Reference

### Stepper

| Prop          | Type                         | Default                                   |
| ------------- | ---------------------------- | ----------------------------------------- |
| `steps`       | `string[]`                   | `["Account", "Plan", "Done"]`             |
| `activeIndex` | `number`                     | `0`                                       |
| `style`       | `StepperStyle`               | `-` (takes precedence over `activeIndex`) |
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"`                            |
| `theme`       | `Partial<FramecnTheme>`      | `-`                                       |
| `className`   | `string`                     | `-`                                       |