# Installation

> Install Stepperize in your React project.

Source: https://stepperize.com/docs/v8/getting-started/installation

Most React apps only install the React package. It includes the React API and depends on the core package for the shared types and pure helpers.

Install the React package with your package manager:

**pnpm**
```bash
pnpm add @stepperize/react
```

**npm**
```bash
npm install @stepperize/react
```

**yarn**
```bash
yarn add @stepperize/react
```

**bun**
```bash
bun add @stepperize/react
```

## First import [#first-import]

Create the stepper definition near the feature that owns the flow. A definition is not React state; it is the typed description of the flow.

```tsx
import { defineStepper } from "@stepperize/react";

const checkout = defineStepper([
  { id: "shipping", title: "Shipping" },
  { id: "payment", title: "Payment" },
  { id: "review", title: "Review" },
]);
```

Only `id` is required. Everything else is your data and stays typed.

## Using your own UI [#using-your-own-ui]

Choose the optional lightweight entry if you do not need generated `Stepper` components:

```tsx
import { defineStepper } from "@stepperize/react/headless";
```

It comes with the same package and retains hooks, Provider, selectors and validation. Its definition has no `Stepper` property. Use the main entry for the accessible UI primitives. See [bundle measurements and a complete example](https://stepperize.com/docs/v8/guides/performance#smaller-bundles-with-your-own-ui).

## TypeScript setup [#typescript-setup]

Stepperize works best when TypeScript can keep your ids literal.

```tsx
const checkout = defineStepper([
  { id: "shipping", title: "Shipping" },
  { id: "payment", title: "Payment" },
  { id: "review", title: "Review" },
]);
```

With the inline array above, TypeScript understands that valid ids are `"shipping" | "payment" | "review"`. That is why `stepper.goTo("paymant")` becomes a type error instead of a runtime surprise.

## Packages [#packages]

| Package | Install when |
| --- | --- |
| `@stepperize/react` | You are building a React app. This includes hooks, provider, primitives, and public types. |
| `@stepperize/core` | You are building adapters, framework-agnostic utilities, or tests around the pure helpers. |

Most apps only need `@stepperize/react`.

## Requirements [#requirements]

Stepperize supports React 18 and 19. It can run in JavaScript too, but you lose most of the type-safety that makes the library useful.

Next: [build your first stepper](https://stepperize.com/docs/v8/getting-started/first-stepper).
