Stepper modal

A setup in steps in a modal: the steps down the left with their state, the current step’s form beside them.

Open full screen

A panel opens over any screen and keeps its own look in every direction: it has no direction of its own.

npx wideset add block-modal-stepper

Import the default export from @/blocks/wideset/modal-stepper. The files below are relative to your project's source directory.

Installed with this block
  • block-styles
  • button
  • checkbox
  • form-field
  • modal
  • progress-stepper
  • select
  • text-input
  • utils
blocks/wideset/modal-stepper/index.tsx
'use client';

import '@/styles/wideset-blocks.css';

import { Button } from '@/components/ui/wideset/button/Button';
import { useState } from 'react';

import { SetupAccountModal } from './setup-account-modal';

/** Stepper modal: a setup in steps over the page, here over an empty page that reopens it. */
export default function ModalStepperBlock() {
  const [open, setOpen] = useState(true);

  return (
    <div className="ws-block-utility bg-ws-static-foreground flex h-dvh items-center justify-center">
      <Button variant="secondary" preset="border" onClick={() => setOpen(true)}>
        Set up account
      </Button>
      <SetupAccountModal open={open} onOpenChange={setOpen} />
    </div>
  );
}