Skip to content

Getting Started

ink-stepper is a component for building interactive step-by-step wizard flows in Ink applications. It handles navigation state, input coordination, and validation so you can focus on building your CLI steps.

Installation

NPM

bash
npm install ink-stepper
bash
pnpm add ink-stepper
bash
yarn add ink-stepper
bash
bun add ink-stepper
bash
deno add npm:ink-stepper

JSR

bash
npx jsr add @archcorsair/ink-stepper
bash
pnpm i jsr:@archcorsair/ink-stepper
bash
yarn add jsr:@archcorsair/ink-stepper
bash
bunx jsr add @archcorsair/ink-stepper
bash
deno add jsr:@archcorsair/ink-stepper

Quick Start

Here is a minimal example of a stepper with three steps:

tsx
import React from 'react';
import { render, Text } from 'ink';
import { Stepper, Step } from 'ink-stepper';

function App() {
  return (
    <Stepper
      onComplete={() => console.log('All done!')}
      onCancel={() => console.log('Cancelled.')}
    >
      <Step name="Welcome">
        <Text>Welcome to the wizard! Press Enter to continue.</Text>
      </Step>

      <Step name="Info">
        <Text>This is step 2.</Text>
      </Step>

      <Step name="Finish">
        <Text>Ready to submit? Press Enter to finish.</Text>
      </Step>
    </Stepper>
  );
}

render(<App />);

Run this with ts-node (or bun) to see an interactive wizard in your terminal.

Released under the MIT License.