{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "multi-step-form",
  "type": "registry:ui",
  "title": "Multi Step Form",
  "description": "One form, a few steps, a last look before it is sent: a booking flow (when, who, check), a sign-up, a request. Every step is a real part of one `<form>`, kept in the page and hidden while it is not the current one, so what the reader typed survives going…",
  "author": "ofri-peretz <https://github.com/ofri-peretz>",
  "categories": [
    "form",
    "pattern"
  ],
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "https://ds.interlace.tools/r/interlace-base.json",
    "https://ds.interlace.tools/r/button.json",
    "https://ds.interlace.tools/r/cn.json",
    "https://ds.interlace.tools/r/motion-token.json",
    "https://ds.interlace.tools/r/use-reduced-motion.json"
  ],
  "files": [
    {
      "path": "registry/interlace-ui/patterns/multi-step-form.tsx",
      "target": "components/ui/patterns/multi-step-form.tsx",
      "type": "registry:ui",
      "content": "'use client';\n\nimport * as React from 'react';\n\n// @interlace/multi-step-form v2.1.3 — Interlace design system.\n// Docs, props and live preview: https://ds.interlace.tools/c/multi-step-form\n// What changed since: https://ds.interlace.tools/c/multi-step-form#history\n// Generated banner — keep it, the upgrade diff reads this version.\n\n/**\n * @interlace/ui — MultiStepForm\n *\n * One form, a few steps, a last look before it is sent: a booking flow\n * (when, who, check), a sign-up, a request. Every step is a real part of\n * one `<form>`, kept in the page and hidden while it is not the current\n * one, so what the reader typed survives going back, and the submit posts\n * every field at once as `FormData`.\n * Inspiration: Stripe Checkout's quiet steps, Cal.com's \"confirm\" screen.\n *\n * ## Flow\n *\n * A flow (docs/philosophies/FLOW_PHILOSOPHY.md) with flat parts, because a\n * server component can compose its steps. The app names the steps; the form\n * owns moving between them. Every phase, the part that shows it, and what\n * moves it on:\n *\n * | Phase   | Part                                       | Leaves by                                          |\n * | ------- | ------------------------------------------ | -------------------------------------------------- |\n * | step    | MultiStepFormStep (one per step, in order) | Continue, once the step checks out → the next step |\n * | invalid | MultiStepFormStep, its error and focus     | the reader fixes the field → Continue again        |\n * | review  | MultiStepFormSummary in the last step      | Change → that step; Submit → the app's `onSubmit`  |\n * | sending | MultiStepForm with `submitting`            | the app clears `submitting`                        |\n * | sent    | the app's own confirmation                 | —                                                  |\n *\n * Back, and a done step in the progress list, return to an earlier step\n * from any phase without checking.\n *\n * ## Anatomy\n *\n *   MultiStepForm                    (form — data-slot=\"multi-step-form\", @container, data-min-viewport=320)\n *     ├─ progress                    (ol — data-slot=\"multi-step-form-progress\")\n *     │   └─ li × n                  (data-state=complete|current|upcoming, aria-current=\"step\")\n *     │       └─ button | span       (a done step is a button back to it)\n *     ├─ MultiStepFormStep × n       (section — data-slot=\"multi-step-form-step\", hidden unless current)\n *     │   ├─ h2 tabIndex=-1          (data-slot=\"multi-step-form-title\": takes focus on arrival)\n *     │   ├─ description             (data-slot=\"multi-step-form-description\")\n *     │   ├─ children                (the step's fields)\n *     │   └─ error                   (data-slot=\"multi-step-form-error\", role=alert)\n *     └─ footer                      (data-slot=\"multi-step-form-footer\": Back, Continue / Submit)\n *\n *   MultiStepFormSummary             (dl — data-slot=\"multi-step-form-summary\": the answers, each with Change)\n *\n * ## Moving between steps\n *\n * Continue checks the current step first: every native constraint on its\n * fields (`required`, `type=\"email\"`, `pattern` …), then the step's own\n * `validate`. The first problem takes focus and a message shows under the\n * step and is read out: the field's name and the browser's own words for a\n * native check (`labels.invalid` rewords it), or what `validate` returned.\n * A field that fails a native check is `aria-invalid` until it is edited. Back never checks. A step already\n * done is a link in the progress list, so the reader can jump back to it;\n * steps ahead cannot be skipped to. `MultiStepFormSummary` lists answers\n * with a Change button that goes straight to the step that asked.\n *\n * On every step change focus moves to the new step's heading, so a screen\n * reader hears \"Step 2 of 3, Your details\" and a keyboard reader starts at\n * the top of the step.\n *\n * ## Motion\n *\n * The new step slides in from the side it lies on (forward from the end,\n * back from the start; mirrored in RTL), 200ms on transform and opacity,\n * and the progress line fills on `--duration-medium`. Under reduced motion\n * the step is simply there.\n *\n * ## MIN_VIEWPORT — 320\n *\n * The progress list queries the form's width: in a phone column it is one\n * line, \"Step 2 of 3 · Your details\" over a segmented bar; from 32rem every\n * step is named.\n *\n * | Rule | Concept                   | Where in this file                                         |\n * | ---- | ------------------------- | ---------------------------------------------------------- |\n * | R4   | Extends native el         | `React.ComponentProps<'form'>`                             |\n * | R6   | data-slot per part        | multi-step-form / -progress / -step / -title / -footer / -summary |\n * | R7   | cn + ...rest              | `cn(…, className)` + `{...props}`                          |\n * | R9   | Controlled + uncontrolled | `step` / `defaultStep` / `onStepChange`                    |\n * | R11  | Composition               | steps are `MultiStepFormStep` children                     |\n * | R14  | Declares min viewport     | `data-min-viewport` + exported const                       |\n * | R19  | Tokens only               | `bg-primary`, `border-border`, `--duration-medium`         |\n * | R26  | A11y                      | a real form; aria-current=\"step\"; focus to the heading; errors announced |\n */\n\nimport { CheckIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { useReducedMotion } from '@/hooks/use-reduced-motion';\nimport { motionEase } from '@/lib/motion-token';\nimport { Button } from '@/components/ui/button';\n\nexport const MIN_VIEWPORT = 320 as const;\n\nexport interface MultiStepFormLabels {\n  /** @default 'Back' */\n  back?: string;\n  /** @default 'Continue' */\n  next?: string;\n  /** The last step's button. @default 'Submit' */\n  submit?: string;\n  /** While `submitting`. @default 'Sending…' */\n  submitting?: string;\n  /** @default (current, total) => `Step ${current} of ${total}` */\n  stepOf?: (current: number, total: number) => string;\n  /** Names the progress list. @default 'Progress' */\n  progress?: string;\n  /** Said after a finished step in the progress list. @default 'Done' */\n  complete?: string;\n  /** The summary's link back to a step. @default 'Change' */\n  edit?: string;\n  /**\n   * The message for a field that fails its native check (`required`, `type=\"email\"` …).\n   * `field` is the control's visible name, or '' when it has none.\n   * @default (field, message) => (field ? `${field}: ${message}` : message), with the browser's own message\n   */\n  invalid?: (field: string, message: string) => string;\n}\n\nconst DEFAULT_LABELS: Required<MultiStepFormLabels> = {\n  back: 'Back',\n  next: 'Continue',\n  submit: 'Submit',\n  submitting: 'Sending…',\n  stepOf: (current, total) => `Step ${current} of ${total}`,\n  progress: 'Progress',\n  complete: 'Done',\n  edit: 'Change',\n  invalid: (field, message) => (field ? `${field}: ${message}` : message),\n};\n\n/** A control's visible name: its <label>, else what aria-labelledby points at. */\nfunction nameOf(control: HTMLElement): string {\n  const label = (control as HTMLInputElement).labels?.[0]?.textContent;\n  if (label) return label.trim();\n  const ids = control.getAttribute('aria-labelledby')?.split(/\\s+/) ?? [];\n  return ids\n    .map((id) => control.ownerDocument.getElementById(id)?.textContent?.trim() ?? '')\n    .filter(Boolean)\n    .join(' ');\n}\n\ninterface StepInfo {\n  id: string;\n  title: React.ReactNode;\n  /** Plain text for the progress list and the heading's step count. */\n  text: string;\n}\n\ninterface MultiStepFormContextValue {\n  steps: StepInfo[];\n  current: string;\n  index: number;\n  goTo: (id: string) => void;\n  labels: Required<MultiStepFormLabels>;\n  errors: Record<string, string | undefined>;\n  headingRef: (id: string) => (el: HTMLHeadingElement | null) => void;\n}\n\nconst MultiStepFormContext = React.createContext<MultiStepFormContextValue | null>(null);\n\n/** The form's state, for a step that needs to move on by itself or show where it is. */\nfunction useMultiStepForm(): Pick<MultiStepFormContextValue, 'steps' | 'current' | 'index' | 'goTo'> {\n  const ctx = React.useContext(MultiStepFormContext);\n  if (!ctx) throw new Error('useMultiStepForm must be used inside a MultiStepForm');\n  const { steps, current, index, goTo } = ctx;\n  return { steps, current, index, goTo };\n}\n\ntype MultiStepFormStepProps = Omit<React.ComponentProps<'section'>, 'title'> & {\n  /** Stable id: the value of `step`, and what the summary links back to. */\n  id: string;\n  title: React.ReactNode;\n  /** Plain text for the progress list, when `title` is not a string. */\n  text?: string;\n  description?: React.ReactNode;\n  /**\n   * Runs on Continue after the native checks pass. Return a message to stay\n   * on the step and show it, or nothing to move on.\n   */\n  validate?: () => string | undefined | null | false;\n};\n\nfunction MultiStepFormStep({\n  id,\n  title,\n  text: _text,\n  description,\n  validate: _validate,\n  className,\n  children,\n  ...props\n}: MultiStepFormStepProps) {\n  const ctx = React.useContext(MultiStepFormContext);\n  if (!ctx) throw new Error('MultiStepFormStep must be used inside a MultiStepForm');\n  const index = ctx.steps.findIndex((s) => s.id === id);\n  const active = ctx.current === id;\n  const titleId = `${id}-title`;\n  const error = ctx.errors[id];\n  return (\n    <section\n      data-slot=\"multi-step-form-step\"\n      data-step={id}\n      data-state={active ? 'current' : index < ctx.index ? 'complete' : 'upcoming'}\n      aria-labelledby={titleId}\n      hidden={!active}\n      className={cn('flex flex-col gap-4', className)}\n      {...props}\n    >\n      <div className=\"flex flex-col gap-1\">\n        <h2\n          ref={ctx.headingRef(id)}\n          id={titleId}\n          tabIndex={-1}\n          data-slot=\"multi-step-form-title\"\n          className=\"text-h3 font-heading font-semibold text-balance focus-visible:outline-hidden\"\n        >\n          <span className=\"sr-only\">{ctx.labels.stepOf(index + 1, ctx.steps.length)}, </span>\n          {title}\n        </h2>\n        {description && (\n          <p data-slot=\"multi-step-form-description\" className=\"text-muted-foreground text-sm\">\n            {description}\n          </p>\n        )}\n      </div>\n      {children}\n      <p\n        role=\"alert\"\n        data-slot=\"multi-step-form-error\"\n        className={cn('text-destructive text-sm font-medium', !error && 'sr-only')}\n      >\n        {error}\n      </p>\n    </section>\n  );\n}\n\nfunction stepsOf(children: React.ReactNode): (StepInfo & { validate?: MultiStepFormStepProps['validate'] })[] {\n  const out: (StepInfo & { validate?: MultiStepFormStepProps['validate'] })[] = [];\n  React.Children.forEach(children, (child) => {\n    if (!React.isValidElement<MultiStepFormStepProps>(child) || child.type !== MultiStepFormStep) return;\n    const { id, title, text, validate } = child.props;\n    out.push({ id, title, text: text ?? (typeof title === 'string' ? title : id), validate });\n  });\n  return out;\n}\n\n/** What can take focus when a step has a problem. */\nconst FIELDS = 'input:not([type=\"hidden\"]), select, textarea, [role=\"radio\"]';\n\ntype MultiStepFormProps = Omit<React.ComponentProps<'form'>, 'onSubmit'> & {\n  /** The current step's id, controlled. */\n  step?: string;\n  /** The step to open on. @default the first */\n  defaultStep?: string;\n  /** Fires with the id of the step the reader moved to. */\n  onStepChange?: (id: string) => void;\n  /**\n   * The last step's submit, with every field of every step. Submit checks only the last\n   * step: earlier ones were checked by Continue. If you jump to the last step with a\n   * controlled `step`, validate the earlier answers yourself.\n   */\n  onSubmit?: (data: FormData, event: React.FormEvent<HTMLFormElement>) => void;\n  /** Disable the buttons and say `labels.submitting` while you send. */\n  submitting?: boolean;\n  labels?: MultiStepFormLabels;\n  children: React.ReactNode;\n};\n\nconst MultiStepForm = React.forwardRef<HTMLFormElement, MultiStepFormProps>(function MultiStepForm(\n  {\n    step: stepProp,\n    defaultStep,\n    onStepChange,\n    onSubmit,\n    submitting = false,\n    labels: labelsProp,\n    className,\n    children,\n    ...props\n  },\n  ref,\n) {\n  const labels = { ...DEFAULT_LABELS, ...labelsProp };\n  const steps = stepsOf(children);\n  const [inner, setInner] = React.useState(defaultStep ?? steps[0]?.id ?? '');\n  const wanted = stepProp ?? inner;\n  // An unknown id falls back to the first step, so a step always shows.\n  const current = steps.some((s) => s.id === wanted) ? wanted : (steps[0]?.id ?? '');\n  const index = Math.max(\n    0,\n    steps.findIndex((s) => s.id === current),\n  );\n  const last = index === steps.length - 1;\n  const [errors, setErrors] = React.useState<Record<string, string | undefined>>({});\n\n  const formRef = React.useRef<HTMLFormElement | null>(null);\n  const headings = React.useRef(new Map<string, HTMLHeadingElement>());\n  const direction = React.useRef<0 | 1 | -1>(0);\n  const reduced = useReducedMotion();\n\n  const setRefs = (el: HTMLFormElement | null) => {\n    formRef.current = el;\n    if (typeof ref === 'function') ref(el);\n    else if (ref) ref.current = el;\n  };\n\n  const headingRef = React.useCallback(\n    (id: string) => (el: HTMLHeadingElement | null) => {\n      if (el) headings.current.set(id, el);\n      else headings.current.delete(id);\n    },\n    [],\n  );\n\n  const goTo = React.useCallback(\n    (id: string) => {\n      if (id === current || !steps.some((s) => s.id === id)) return;\n      const to = steps.findIndex((s) => s.id === id);\n      direction.current = to > index ? 1 : -1;\n      if (stepProp === undefined) setInner(id);\n      onStepChange?.(id);\n    },\n    // `steps` is rebuilt from children on every render.\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [current, index, stepProp, onStepChange, children],\n  );\n\n  React.useLayoutEffect(() => {\n    const dir = direction.current;\n    if (!dir) return;\n    direction.current = 0;\n    const heading = headings.current.get(current);\n    heading?.focus({ preventScroll: true });\n    heading?.scrollIntoView?.({ block: 'nearest' });\n    const section = heading?.closest('section');\n    if (reduced || !section || typeof section.animate !== 'function') return;\n    const rtl = section.closest('[dir]')?.getAttribute('dir') === 'rtl';\n    section.animate(\n      [\n        { transform: `translateX(${(rtl ? -dir : dir) * 1}rem)`, opacity: 0 },\n        { transform: 'translateX(0)', opacity: 1 },\n      ],\n      { duration: 200, easing: motionEase(section, 'enter') },\n    );\n  }, [current, reduced]);\n\n  /** Native checks, then the step's own. Returns true when the step may be left. */\n  const check = (): boolean => {\n    const step = steps[index];\n    const section = [\n      ...formRef.current!.querySelectorAll<HTMLElement>('[data-slot=\"multi-step-form-step\"]'),\n    ].find((el) => el.dataset.step === current);\n    if (section) {\n      const controls = [...section.querySelectorAll<HTMLInputElement>('input, select, textarea')];\n      const invalid = controls.filter((c) => !c.disabled && !c.checkValidity());\n      if (invalid.length > 0) {\n        const first = invalid[0]!;\n        // Say what is wrong, not only where: focus alone leaves a sighted reader guessing. Each\n        // failing field is marked invalid until it is edited.\n        for (const c of invalid) {\n          if (c.type === 'hidden') continue;\n          c.setAttribute('aria-invalid', 'true');\n          c.addEventListener('input', () => c.removeAttribute('aria-invalid'), { once: true });\n        }\n        // A hidden input (a radio group's value) cannot take focus or carry a name: its group can.\n        const hidden = first.type === 'hidden' || first.getAttribute('aria-hidden') === 'true';\n        const radio = hidden ? first.parentElement?.querySelector<HTMLElement>('[role=\"radio\"]') : null;\n        const target = radio ?? first;\n        const group = radio?.closest<HTMLElement>('[role=\"radiogroup\"]');\n        // Browsers always fill validationMessage for a failed check; the fallback is for\n        // environments that don't (jsdom), so a custom `invalid` never gets an empty message.\n        const message = first.validationMessage || 'Check this answer.';\n        setErrors((prev) => ({\n          ...prev,\n          [current]: labels.invalid(group ? nameOf(group) : nameOf(target), message),\n        }));\n        target.focus();\n        return false;\n      }\n    }\n    const message = step?.validate?.() || undefined;\n    setErrors((prev) => ({ ...prev, [current]: message }));\n    if (message) {\n      section?.querySelector<HTMLElement>(FIELDS)?.focus();\n      return false;\n    }\n    return true;\n  };\n\n  const next = () => {\n    if (!check()) return;\n    const to = steps[index + 1];\n    if (to) goTo(to.id);\n  };\n\n  // Back only shows from the second step on.\n  const back = () => goTo(steps[index - 1]!.id);\n\n  const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {\n    event.preventDefault();\n    if (submitting) return;\n    if (!last) {\n      next();\n      return;\n    }\n    if (!check()) return;\n    onSubmit?.(new FormData(event.currentTarget), event);\n  };\n\n  const ctx: MultiStepFormContextValue = { steps, current, index, goTo, labels, errors, headingRef };\n\n  return (\n    <MultiStepFormContext.Provider value={ctx}>\n      <form\n        ref={setRefs}\n        data-slot=\"multi-step-form\"\n        data-min-viewport={String(MIN_VIEWPORT)}\n        noValidate\n        onSubmit={handleSubmit}\n        className={cn('@container flex w-full min-w-0 flex-col gap-6', className)}\n        {...props}\n      >\n        <nav aria-label={labels.progress} className=\"flex flex-col gap-2\">\n          <p\n            aria-hidden=\"true\"\n            className=\"text-muted-foreground flex min-w-0 gap-1 text-sm @lg:hidden\"\n          >\n            <span className=\"shrink-0\">{labels.stepOf(index + 1, steps.length)}</span>\n            <span className=\"shrink-0\">·</span>\n            <span className=\"text-foreground truncate font-medium\">{steps[index]?.text}</span>\n          </p>\n          <div\n            aria-hidden=\"true\"\n            data-slot=\"multi-step-form-bar\"\n            className=\"grid auto-cols-fr grid-flow-col gap-1 @lg:hidden\"\n          >\n            {steps.map((s, i) => (\n              <span\n                key={s.id}\n                className={cn(\n                  'h-1 rounded-full transition-colors duration-(--duration-medium) ease-move',\n                  i <= index ? 'bg-primary' : 'bg-border',\n                )}\n              />\n            ))}\n          </div>\n          <ol\n            data-slot=\"multi-step-form-progress\"\n            className=\"hidden @lg:grid @lg:grid-flow-col @lg:auto-cols-fr @lg:gap-2\"\n          >\n            {steps.map((s, i) => {\n              const state = i < index ? 'complete' : i === index ? 'current' : 'upcoming';\n              const marker = (\n                <>\n                  <span\n                    aria-hidden=\"true\"\n                    className={cn(\n                      'flex size-6 shrink-0 items-center justify-center rounded-full border text-xs font-semibold tabular-nums transition-colors duration-(--duration-medium) ease-move',\n                      state === 'complete' && 'bg-primary border-primary text-primary-foreground',\n                      state === 'current' && 'border-primary text-primary border-2',\n                      state === 'upcoming' && 'border-input text-muted-foreground',\n                    )}\n                  >\n                    {state === 'complete' ? <CheckIcon className=\"size-3.5\" /> : i + 1}\n                  </span>\n                  <span className={cn('min-w-0 truncate', state === 'upcoming' && 'text-muted-foreground')}>\n                    {s.text}\n                  </span>\n                  {state === 'complete' && <span className=\"sr-only\">, {labels.complete}</span>}\n                </>\n              );\n              return (\n                <li\n                  key={s.id}\n                  data-state={state}\n                  aria-current={state === 'current' ? 'step' : undefined}\n                  className={cn(\n                    'border-t-2 pt-2 text-sm font-medium transition-colors duration-(--duration-medium) ease-move',\n                    state === 'upcoming' ? 'border-border' : 'border-primary',\n                  )}\n                >\n                  {state === 'complete' ? (\n                    <button\n                      type=\"button\"\n                      onClick={() => goTo(s.id)}\n                      className=\"hover:text-primary -m-1 flex w-[calc(100%+0.5rem)] min-w-0 items-center gap-2 rounded-md p-1 text-start focus-visible:outline-hidden transition-colors duration-(--duration-fast) ease-enter focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n                    >\n                      {marker}\n                    </button>\n                  ) : (\n                    <span className=\"flex min-w-0 items-center gap-2\">{marker}</span>\n                  )}\n                </li>\n              );\n            })}\n          </ol>\n        </nav>\n        <div data-slot=\"multi-step-form-steps\" className=\"min-w-0\">\n          {children}\n        </div>\n        <div\n          data-slot=\"multi-step-form-footer\"\n          className=\"border-border flex flex-wrap-reverse items-center justify-between gap-3 border-t pt-4\"\n        >\n          {index > 0 ? (\n            <Button type=\"button\" variant=\"ghost\" onClick={back} disabled={submitting}>\n              {labels.back}\n            </Button>\n          ) : (\n            <span />\n          )}\n          <Button type=\"submit\" disabled={submitting} aria-busy={submitting || undefined}>\n            {last ? (submitting ? labels.submitting : labels.submit) : labels.next}\n          </Button>\n        </div>\n      </form>\n    </MultiStepFormContext.Provider>\n  );\n});\n\ninterface SummaryItem {\n  /** What was asked, e.g. \"Date\". */\n  label: React.ReactNode;\n  /** The answer. Empty answers read `emptyText`. */\n  value: React.ReactNode;\n  /** The step that asked: adds a Change button back to it. */\n  step?: string;\n}\n\ntype MultiStepFormSummaryProps = React.ComponentProps<'dl'> & {\n  items: readonly SummaryItem[];\n  /** Said for an empty answer. @default 'Not given' */\n  emptyText?: string;\n};\n\n/** The answers, each with a way back to the step that asked. Put it in the last step. */\nfunction MultiStepFormSummary({\n  items,\n  emptyText = 'Not given',\n  className,\n  ...props\n}: MultiStepFormSummaryProps) {\n  const ctx = React.useContext(MultiStepFormContext);\n  const id = React.useId();\n  return (\n    <dl\n      data-slot=\"multi-step-form-summary\"\n      className={cn('divide-border border-border divide-y rounded-lg border', className)}\n      {...props}\n    >\n      {items.map((item, i) => {\n        const empty = item.value === null || item.value === undefined || item.value === '';\n        return (\n          <div key={i} className=\"flex flex-wrap items-baseline gap-x-4 gap-y-1 px-4 py-3\">\n            <dt id={`${id}-${i}`} className=\"text-muted-foreground w-full text-sm @md:w-32 @md:shrink-0\">\n              {item.label}\n            </dt>\n            <dd\n              // A long word (an email, a name) wraps instead of pushing the page sideways.\n              className={cn('min-w-0 flex-1 text-sm font-medium wrap-anywhere', empty && 'text-muted-foreground font-normal')}\n            >\n              {empty ? emptyText : item.value}\n            </dd>\n            {item.step && ctx && (\n              <dd className=\"ms-auto\">\n                <Button\n                  type=\"button\"\n                  variant=\"link\"\n                  size=\"sm\"\n                  onClick={() => ctx.goTo(item.step!)}\n                  // A text label names the button \"Change: Email\"; any other label is read\n                  // from its <dt>, so every Change button still says which answer it changes.\n                  {...(typeof item.label === 'string'\n                    ? { 'aria-label': `${ctx.labels.edit}: ${item.label}` }\n                    : { id: `${id}-${i}-edit`, 'aria-labelledby': `${id}-${i}-edit ${id}-${i}` })}\n                  className=\"h-auto px-0\"\n                >\n                  {ctx.labels.edit}\n                </Button>\n              </dd>\n            )}\n          </div>\n        );\n      })}\n    </dl>\n  );\n}\n\nMultiStepForm.displayName = 'MultiStepForm';\nMultiStepFormStep.displayName = 'MultiStepFormStep';\nMultiStepFormSummary.displayName = 'MultiStepFormSummary';\n\nexport { MultiStepForm, MultiStepFormStep, MultiStepFormSummary, useMultiStepForm };\nexport type { MultiStepFormProps, MultiStepFormStepProps, MultiStepFormSummaryProps, SummaryItem };\n"
    }
  ],
  "meta": {
    "tier": "pattern",
    "client": true,
    "minViewport": 320,
    "loading": false,
    "version": "2.1.3",
    "since": "2.0.0"
  },
  "docs": "## @interlace/multi-step-form\n\nInstalled to `components/ui/patterns/multi-step-form.tsx`.\n\n```tsx\nimport { /* … */ } from '@/components/ui/patterns/multi-step-form';\n```\n\nProps, a11y contract, live preview and source: https://ds.interlace.tools/c/multi-step-form\n\nRequires the `@interlace/interlace-base` CSS baseline (installed automatically as a registry dependency). For the Interlace look, also add `@interlace/theme`."
}
