Code

<!-- pearl-steps.free.js: download it from the Install section below and host it with your site -->
<script src="/pearl-steps.free.js" defer></script>

<pearl-steps value="2" size="36" clickable label="Checkout" theme="light">
  <li>Cart</li>
  <li data-description="Standard, 2–4 days">Shipping</li>
  <li>Payment</li>
  <li>Review</li>
</pearl-steps>

<script>
  const steps = document.querySelector('pearl-steps');
  document.querySelector('#continue').addEventListener('click', () => steps.next());
  steps.addEventListener('change', (e) => {
    console.log('back to step', e.detail.value);
  });
</script>

In context

Vertical, with descriptions
  1. Completed: Upload
  2. Check
  3. Publish
Mint, moving on by itself Pro

Install · Free Web Component

One file, no dependencies. Aurora preset, every other option included. Host it yourself so your visitors never load anything from our servers.

1. Install with one command — or download the file
shadcn CLI · React
npx shadcn@latest add https://www.ui-design.co/r/pearl-steps.json
2. Load it and use the element
HTML
<!-- pearl-steps.free.js: download it from the Install section below and host it with your site -->
<script src="/pearl-steps.free.js" defer></script>

<pearl-steps value="1" size="36" clickable label="Checkout" theme="light">
  <li>Cart</li>
  <li data-description="Standard, 2–4 days">Shipping</li>
  <li>Payment</li>
  <li>Review</li>
</pearl-steps>

<script>
  const steps = document.querySelector('pearl-steps');
  document.querySelector('#continue').addEventListener('click', () => steps.next());
  steps.addEventListener('change', (e) => {
    console.log('back to step', e.detail.value);
  });
</script>
3. React + TypeScript (optional)

The shadcn command adds a typed React wrapper for you. Using the file directly? Custom elements work in React as-is; for type checking add:

TypeScript
// pearl-steps.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'pearl-steps': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      value?: number | string;
      orientation?: 'horizontal' | 'vertical';
      size?: number | string;
      width?: number | string;
      clickable?: boolean | '';
      label?: string;
      theme?: 'light' | 'dark';
      sound?: boolean | '';
    };
  }
}

Pro · React + TypeScript Pro

One payment of $4.99, yours forever. Use it in unlimited personal and commercial projects; no resale.

  • React component (controlled or uncontrolled) with TypeScript types and the full source
  • Sunset, Mint and Mono tints, plus custom tints from Brand Fit
  • The vanilla Web Component with every tint, a demo page, README and license

Attributes & props

NameTypeDefaultDescription
<li> children—The steps, in order: the text is the label, data-description="…" adds a second line. From script: el.steps = [{ label, description }].
value number0Index of the current step, 0-based. Steps before it are done; a value equal to the number of steps means everything is done.
orientation 'horizontal' | 'vertical''horizontal'A row with labels underneath, or a column with labels and descriptions beside the beads.
size number (px)36Bead size; the tube and the labels scale with it.
width number (px) | CSS width100%Width of the whole stepper; the steps share it equally.
clickable booleanoffFinished steps become buttons that go back: the element sets value and fires change with detail.value. Upcoming steps cannot be jumped to.
next() / prev() methods—Move one step forward or back from script.
label string'Progress'Accessible name of the list.
theme 'light' | 'dark''light'White porcelain or dark.
sound booleanoffA porcelain tap when you step back. Also on for everything inside an element with data-ui-sound="on".
tint Pro'aurora' | 'sunset' | 'mint' | 'mono' | object'aurora'Colours of the light in the tube and of the halo, or a custom tint. Free build ships Aurora only.

It is an ordered list: the current step carries aria-current="step" and finished ones are announced as “Completed”. The stepper shows progress — it does not hide or show your form panels; switch those yourself from value. In a row each step gets an equal share of the width, so keep labels to a word or two, or go vertical on narrow screens. The first paint is still; the flow, the check and the rising bead play only when the value changes. All CSS, no WebGL.

More components