Skip to content
ui8kit

block / account

Signup Wizard

A sign-up in steps with a progress bar or a list of steps; back and next move between them.

Install

npx ui8kit add signup-wizard

Pulls in: block, box, button, compose, field, group, input, kit-box, kit-button, kit-input, kit-progress, kit-text, list, list-item, lucide-icon, progress, stack, text, title, utils

Preview

Create your account

Step 1 of 3

Create your account

Use your work email.

Code

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework svelte --dir src --registry-url https://registry.buildy.tw/svelte --strict-cdn
npx ui8kit add signup-wizard
blocks/signup-wizard.svelte
<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
  A sign-up in steps: the progress, the fields of the current step, back and next. `current` is the step shown,
  counted from 1. Axes: progress (bar, list: every step named), layout (card, plain). Keeping the typed values
  between steps is the page's job.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { WizardStep, WizardLabels } from "./signup-wizard.types";

  export type SignupWizardProps = {
    id: string;
    title: string;
    steps: WizardStep[];
    labels: WizardLabels;
    current?: number;
    level?: 1 | 2;
    progress?: "bar" | "list";
    layout?: "card" | "plain";
    landmarkLabel?: string;
    ongo?: (step: number) => void;
  };
</script>

<script lang="ts">
  import Block from "../compose/Block.svelte";
  import Box from "../compose/Box.svelte";
  import Button from "../compose/Button.svelte";
  import Group from "../compose/Group.svelte";
  import Input from "../compose/Input.svelte";
  import List from "../compose/List.svelte";
  import ListItem from "../compose/ListItem.svelte";
  import LucideIcon from "../icons/LucideIcon.svelte";
  import Progress from "../compose/Progress.svelte";
  import Stack from "../compose/Stack.svelte";
  import Text from "../compose/Text.svelte";
  import Title from "../compose/Title.svelte";
  import Field from "../components/field.svelte";
  import { cn, tpl } from "../utils";

  let {
    id,
    title,
    steps,
    labels,
    current = 1,
    level = 2,
    progress = "bar",
    layout = "card",
    landmarkLabel,
    ongo,
  }: SignupWizardProps = $props();
</script>

{#if ((steps?.length ?? 0) > 0)}
  <Block
    tag="section"
    class={cn(
      "mx-auto flex w-full max-w-lg flex-col gap-6 px-4 py-8",
      (((layout as string) === "card") ? "rounded bg-card p-6 inset-ring inset-ring-border" : "")
    )}
    aria-labelledby={(landmarkLabel ? undefined : tpl("{0}-title", id))}
    data-current={(current == null ? undefined : String(current))}
    aria-label={landmarkLabel}
    data-slot="wizard"
  >
    <Title as={level} size="2xl" weight="bold" id={tpl("{0}-title", id)}>
      {title}
    </Title>
    <Text size="sm" class="text-muted-foreground" data-slot="step-of">
      {tpl(labels.stepOf, current, (steps?.length ?? 0))}
    </Text>
    {#if ((progress as string) === "bar")}
      <Progress
        value={(current == null ? undefined : String(current))}
        max={((steps?.length ?? 0) == null ? undefined : String((steps?.length ?? 0)))}
        aria-label={labels.steps}
      />
    {/if}
    {#if ((progress as string) === "list")}
      <List class="m-0 flex list-none flex-col gap-2 p-0" aria-label={labels.steps} data-slot="step-list">
        {#each steps as s, i (s.id)}
          <ListItem
            class={cn(
              "flex items-center gap-4 text-sm",
              (((i + 1) === current) ? "font-semibold" : "text-muted-foreground")
            )}
            aria-current={(((i + 1) === current) ? "step" : undefined)}
            data-slot="step-item"
          >
            <LucideIcon name={(((i + 1) < current) ? "circle-check" : s.icon)} size={16} />
            {s.title}
          </ListItem>
        {/each}
      </List>
    {/if}
    {#each steps as s, i (s.id)}
      {#if ((i + 1) === current)}
        <Stack gap="4" align="stretch" data-slot="step">
          <Title as={3} size="xl" weight="bold">
            {s.title}
          </Title>
          <Text size="sm" class="text-muted-foreground">
            {s.text}
          </Text>
          <Box class="grid gap-4">
            <Field label={s.fieldA} htmlFor={tpl("{0}-a", id)}>
              <Input type="text" name={tpl("{0}-a", id)} id={tpl("{0}-a", id)} data-slot="field" />
            </Field>
            <Field label={s.fieldB} htmlFor={tpl("{0}-b", id)}>
              <Input type="text" name={tpl("{0}-b", id)} id={tpl("{0}-b", id)} data-slot="field" />
            </Field>
          </Box>
        </Stack>
      {/if}
    {/each}
    <Group gap="2" justify="between">
      <Button
        variant="outline"
        size="default"
        type="button"
        disabled={(current < 2)}
        onclick={() => ongo?.((current - 1))}
      >
        {labels.back}
      </Button>
      <Button variant="default" size="default" type="button" onclick={() => ongo?.((current + 1))}>
        {((current >= (steps?.length ?? 0)) ? labels.finish : labels.next)}
      </Button>
    </Group>
  </Block>
{/if}
blocks/signup-wizard.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type WizardStep = {
  id: string;
  title: string;
  text: string;
  icon: string;
  fieldA: string;
  fieldB: string;
};

export type WizardLabels = {
  stepOf: string;
  steps: string;
  back: string;
  next: string;
  finish: string;
};

Svelte registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework react --dir src --registry-url https://registry.buildy.tw/react --strict-cdn
npx ui8kit add signup-wizard
blocks/signup-wizard.tsx
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
 * A sign-up in steps: the progress, the fields of the current step, back and next. `current` is the step shown,
 * counted from 1. Axes: progress (bar, list: every step named), layout (card, plain). Keeping the typed values
 * between steps is the page's job.
 */
import { Fragment, type ReactNode } from "react";
import { Block, Box, Button, Group, Input, List, ListItem, Progress, Stack, Text, Title } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { Field } from "../components/field";
import { cn, tpl } from "../utils";
import type { WizardStep, WizardLabels } from "./signup-wizard.types";

export type SignupWizardProps = {
  id: string;
  title: string;
  steps: WizardStep[];
  labels: WizardLabels;
  current?: number;
  level?: 1 | 2;
  progress?: "bar" | "list";
  layout?: "card" | "plain";
  landmarkLabel?: string;
  onGo?: (step: number) => void;
};

export function SignupWizard({
  id,
  title,
  steps,
  labels,
  current = 1,
  level = 2,
  progress = "bar",
  layout = "card",
  landmarkLabel,
  onGo,
}: SignupWizardProps) {
  return (
    <>
      {((steps?.length ?? 0) > 0) ? (
        <Block
          tag="section"
          className={cn(
            "mx-auto flex w-full max-w-lg flex-col gap-6 px-4 py-8",
            (((layout as string) === "card") ? "rounded bg-card p-6 inset-ring inset-ring-border" : "")
          )}
          aria-labelledby={(landmarkLabel ? undefined : tpl("{0}-title", id))}
          data-current={(current == null ? undefined : String(current))}
          aria-label={landmarkLabel}
          data-slot="wizard"
        >
          <Title as={level} size="2xl" weight="bold" id={tpl("{0}-title", id)}>
            {title}
          </Title>
          <Text size="sm" className="text-muted-foreground" data-slot="step-of">
            {tpl(labels.stepOf, current, (steps?.length ?? 0))}
          </Text>
          {((progress as string) === "bar") ? (
            <Progress
              value={(current == null ? undefined : String(current))}
              max={((steps?.length ?? 0) == null ? undefined : String((steps?.length ?? 0)))}
              aria-label={labels.steps}
            />
          ) : null}
          {((progress as string) === "list") ? (
            <List className="m-0 flex list-none flex-col gap-2 p-0" aria-label={labels.steps} data-slot="step-list">
              {(steps ?? []).map((s, i) => (
                <ListItem key={s.id}
                  className={cn(
                    "flex items-center gap-4 text-sm",
                    (((i + 1) === current) ? "font-semibold" : "text-muted-foreground")
                  )}
                  aria-current={(((i + 1) === current) ? "step" : undefined)}
                  data-slot="step-item"
                >
                  <LucideIcon name={(((i + 1) < current) ? "circle-check" : s.icon)} size={16} />
                  {s.title}
                </ListItem>
              ))}
            </List>
          ) : null}
          {(steps ?? []).map((s, i) => (
            <Fragment key={s.id}>
              {((i + 1) === current) ? (
                <Stack gap="4" align="stretch" data-slot="step">
                  <Title as={3} size="xl" weight="bold">
                    {s.title}
                  </Title>
                  <Text size="sm" className="text-muted-foreground">
                    {s.text}
                  </Text>
                  <Box className="grid gap-4">
                    <Field label={s.fieldA} htmlFor={tpl("{0}-a", id)}>
                      <Input type="text" name={tpl("{0}-a", id)} id={tpl("{0}-a", id)} data-slot="field" />
                    </Field>
                    <Field label={s.fieldB} htmlFor={tpl("{0}-b", id)}>
                      <Input type="text" name={tpl("{0}-b", id)} id={tpl("{0}-b", id)} data-slot="field" />
                    </Field>
                  </Box>
                </Stack>
              ) : null}
            </Fragment>
          ))}
          <Group gap="2" justify="between">
            <Button
              variant="outline"
              size="default"
              type="button"
              disabled={(current < 2)}
              onClick={() => onGo?.((current - 1))}
            >
              {labels.back}
            </Button>
            <Button variant="default" size="default" type="button" onClick={() => onGo?.((current + 1))}>
              {((current >= (steps?.length ?? 0)) ? labels.finish : labels.next)}
            </Button>
          </Group>
        </Block>
      ) : null}
    </>
  );
}
blocks/signup-wizard.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type WizardStep = {
  id: string;
  title: string;
  text: string;
  icon: string;
  fieldA: string;
  fieldB: string;
};

export type WizardLabels = {
  stepOf: string;
  steps: string;
  back: string;
  next: string;
  finish: string;
};

React registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework vue --dir src --registry-url https://registry.buildy.tw/vue --strict-cdn
npx ui8kit add signup-wizard
blocks/signup-wizard.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type WizardStep = {
  id: string;
  title: string;
  text: string;
  icon: string;
  fieldA: string;
  fieldB: string;
};

export type WizardLabels = {
  stepOf: string;
  steps: string;
  back: string;
  next: string;
  finish: string;
};
blocks/signup-wizard.vue
<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
  A sign-up in steps: the progress, the fields of the current step, back and next. `current` is the step shown,
  counted from 1. Axes: progress (bar, list: every step named), layout (card, plain). Keeping the typed values
  between steps is the page's job.
-->
<script lang="ts">
import type { WizardStep, WizardLabels } from "./signup-wizard.types";

export type SignupWizardProps = {
  id: string;
  title: string;
  steps: WizardStep[];
  labels: WizardLabels;
  current?: number;
  level?: 1 | 2;
  progress?: "bar" | "list";
  layout?: "card" | "plain";
  landmarkLabel?: string;
};
</script>

<script setup lang="ts">
import Block from "../compose/Block.vue";
import Box from "../compose/Box.vue";
import Button from "../compose/Button.vue";
import Group from "../compose/Group.vue";
import Input from "../compose/Input.vue";
import List from "../compose/List.vue";
import ListItem from "../compose/ListItem.vue";
import LucideIcon from "../icons/LucideIcon.vue";
import Progress from "../compose/Progress.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
import Title from "../compose/Title.vue";
import Field from "../components/field.vue";
import { cn, tpl } from "../utils";

const {
  id,
  title,
  steps,
  labels,
  current = 1,
  level = 2,
  progress = "bar",
  layout = "card",
  landmarkLabel,
} = defineProps<SignupWizardProps>();
const emit = defineEmits<{ go: [step: number] }>();
</script>

<template>
  <Block v-if="((steps?.length ?? 0) > 0)"
    tag="section"
    :class="cn(
      'mx-auto flex w-full max-w-lg flex-col gap-6 px-4 py-8',
      (((layout as string) === 'card') ? 'rounded bg-card p-6 inset-ring inset-ring-border' : '')
    )"
    :aria-labelledby="(landmarkLabel ? undefined : tpl('{0}-title', id))"
    :data-current="(current == null ? undefined : String(current))"
    :aria-label="landmarkLabel"
    data-slot="wizard"
  >
    <Title :as="level" size="2xl" weight="bold" :id="tpl('{0}-title', id)">
      {{ title }}
    </Title>
    <Text size="sm" class="text-muted-foreground" data-slot="step-of">
      {{ tpl(labels.stepOf, current, (steps?.length ?? 0)) }}
    </Text>
    <Progress v-if="((progress as string) === 'bar')"
      :value="(current == null ? undefined : String(current))"
      :max="((steps?.length ?? 0) == null ? undefined : String((steps?.length ?? 0)))"
      :aria-label="labels.steps"
    />
    <List
      v-if="((progress as string) === 'list')"
      class="m-0 flex list-none flex-col gap-2 p-0"
      :aria-label="labels.steps"
      data-slot="step-list"
    >
      <ListItem v-for="(s, i) in steps" :key="s.id"
        :class="cn(
          'flex items-center gap-4 text-sm',
          (((i + 1) === current) ? 'font-semibold' : 'text-muted-foreground')
        )"
        :aria-current="(((i + 1) === current) ? 'step' : undefined)"
        data-slot="step-item"
      >
        <LucideIcon :name="(((i + 1) < current) ? 'circle-check' : s.icon)" :size="16" />
        {{ s.title }}
      </ListItem>
    </List>
    <template v-for="(s, i) in steps" :key="s.id">
      <Stack v-if="((i + 1) === current)" gap="4" align="stretch" data-slot="step">
        <Title :as="3" size="xl" weight="bold">
          {{ s.title }}
        </Title>
        <Text size="sm" class="text-muted-foreground">
          {{ s.text }}
        </Text>
        <Box class="grid gap-4">
          <Field :label="s.fieldA" :htmlFor="tpl('{0}-a', id)">
            <Input type="text" :name="tpl('{0}-a', id)" :id="tpl('{0}-a', id)" data-slot="field" />
          </Field>
          <Field :label="s.fieldB" :htmlFor="tpl('{0}-b', id)">
            <Input type="text" :name="tpl('{0}-b', id)" :id="tpl('{0}-b', id)" data-slot="field" />
          </Field>
        </Box>
      </Stack>
    </template>
    <Group gap="2" justify="between">
      <Button
        variant="outline"
        size="default"
        type="button"
        :disabled="(current < 2)"
        @click="() => emit('go', (current - 1))"
      >
        {{ labels.back }}
      </Button>
      <Button variant="default" size="default" type="button" @click="() => emit('go', (current + 1))">
        {{ ((current >= (steps?.length ?? 0)) ? labels.finish : labels.next) }}
      </Button>
    </Group>
  </Block>
</template>

Vue registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework solid --dir src --registry-url https://registry.buildy.tw/solid --strict-cdn
npx ui8kit add signup-wizard
blocks/signup-wizard.tsx
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
 * A sign-up in steps: the progress, the fields of the current step, back and next. `current` is the step shown,
 * counted from 1. Axes: progress (bar, list: every step named), layout (card, plain). Keeping the typed values
 * between steps is the page's job.
 */
import { For, type JSX } from "solid-js";
import { Block, Box, Button, Group, Input, List, ListItem, Progress, Stack, Text, Title } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { Field } from "../components/field";
import { cn, tpl } from "../utils";
import type { WizardStep, WizardLabels } from "./signup-wizard.types";

export type SignupWizardProps = {
  id: string;
  title: string;
  steps: WizardStep[];
  labels: WizardLabels;
  current?: number;
  level?: 1 | 2;
  progress?: "bar" | "list";
  layout?: "card" | "plain";
  landmarkLabel?: string;
  onGo?: (step: number) => void;
};

export function SignupWizard({
  id,
  title,
  steps,
  labels,
  current = 1,
  level = 2,
  progress = "bar",
  layout = "card",
  landmarkLabel,
  onGo,
}: SignupWizardProps) {
  return (
    <>
      {((steps?.length ?? 0) > 0) ? (
        <Block
          tag="section"
          class={cn(
            "mx-auto flex w-full max-w-lg flex-col gap-6 px-4 py-8",
            (((layout as string) === "card") ? "rounded bg-card p-6 inset-ring inset-ring-border" : "")
          )}
          aria-labelledby={(landmarkLabel ? undefined : tpl("{0}-title", id))}
          data-current={(current == null ? undefined : String(current))}
          aria-label={landmarkLabel}
          data-slot="wizard"
        >
          <Title as={level} size="2xl" weight="bold" id={tpl("{0}-title", id)}>
            {title}
          </Title>
          <Text size="sm" class="text-muted-foreground" data-slot="step-of">
            {tpl(labels.stepOf, current, (steps?.length ?? 0))}
          </Text>
          {((progress as string) === "bar") ? (
            <Progress
              value={(current == null ? undefined : String(current))}
              max={((steps?.length ?? 0) == null ? undefined : String((steps?.length ?? 0)))}
              aria-label={labels.steps}
            />
          ) : null}
          {((progress as string) === "list") ? (
            <List class="m-0 flex list-none flex-col gap-2 p-0" aria-label={labels.steps} data-slot="step-list">
              <For each={steps ?? []}>{(s, iOf) => { const i = iOf(); return (
                <ListItem
                  class={cn(
                    "flex items-center gap-4 text-sm",
                    (((i + 1) === current) ? "font-semibold" : "text-muted-foreground")
                  )}
                  aria-current={(((i + 1) === current) ? "step" : undefined)}
                  data-slot="step-item"
                >
                  <LucideIcon name={(((i + 1) < current) ? "circle-check" : s.icon)} size={16} />
                  {s.title}
                </ListItem>
              ); }}</For>
            </List>
          ) : null}
          <For each={steps ?? []}>{(s, iOf) => { const i = iOf(); return (
            <>
              {((i + 1) === current) ? (
                <Stack gap="4" align="stretch" data-slot="step">
                  <Title as={3} size="xl" weight="bold">
                    {s.title}
                  </Title>
                  <Text size="sm" class="text-muted-foreground">
                    {s.text}
                  </Text>
                  <Box class="grid gap-4">
                    <Field label={s.fieldA} htmlFor={tpl("{0}-a", id)}>
                      <Input type="text" name={tpl("{0}-a", id)} id={tpl("{0}-a", id)} data-slot="field" />
                    </Field>
                    <Field label={s.fieldB} htmlFor={tpl("{0}-b", id)}>
                      <Input type="text" name={tpl("{0}-b", id)} id={tpl("{0}-b", id)} data-slot="field" />
                    </Field>
                  </Box>
                </Stack>
              ) : null}
            </>
          ); }}</For>
          <Group gap="2" justify="between">
            <Button
              variant="outline"
              size="default"
              type="button"
              disabled={(current < 2)}
              onClick={() => onGo?.((current - 1))}
            >
              {labels.back}
            </Button>
            <Button variant="default" size="default" type="button" onClick={() => onGo?.((current + 1))}>
              {((current >= (steps?.length ?? 0)) ? labels.finish : labels.next)}
            </Button>
          </Group>
        </Block>
      ) : null}
    </>
  );
}
blocks/signup-wizard.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type WizardStep = {
  id: string;
  title: string;
  text: string;
  icon: string;
  fieldA: string;
  fieldB: string;
};

export type WizardLabels = {
  stepOf: string;
  steps: string;
  back: string;
  next: string;
  finish: string;
};

Solid registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework templ --dir src --registry-url https://registry.buildy.tw/templ --strict-cdn
npx ui8kit add signup-wizard
blocks/signup-wizard.templ
// Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
// Source: packages/compose-gen/specs/organisms/signup-wizard.json

package blocks

import (
	"github.com/ui8kit/codegen/generated/templ/ui/box"
	"github.com/ui8kit/codegen/generated/templ/ui/button"
	"github.com/ui8kit/codegen/generated/templ/compose"
	"github.com/ui8kit/codegen/generated/templ/icons"
	"github.com/ui8kit/codegen/generated/templ/ui/input"
	"github.com/ui8kit/codegen/generated/templ/ui/progress"
	"github.com/ui8kit/codegen/generated/templ/ui/text"
	uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)

// SignupWizardProps are the props of SignupWizard; the values are the JSON shapes of the TypeScript props.
type SignupWizardProps struct {
	Id any `json:"id"`
	Title any `json:"title"`
	Steps any `json:"steps"`
	Labels any `json:"labels"`
	Current any `json:"current"`
	Level any `json:"level"`
	Progress any `json:"progress"`
	Layout any `json:"layout"`
	LandmarkLabel any `json:"landmarkLabel"`
}

// A sign-up in steps: the progress, the fields of the current step, back and next. `current` is the step shown, counted from 1. Axes: progress (bar, list: every step named), layout (card, plain). Keeping the typed values between steps is the page's job.
templ SignupWizard(p SignupWizardProps) {
	{{ vId := p.Id }}
	{{ vTitle := p.Title }}
	{{ vSteps := p.Steps }}
	{{ vLabels := p.Labels }}
	{{ vCurrent := uiutils.Def(p.Current, float64(1)) }}
	{{ vLevel := uiutils.Def(p.Level, float64(2)) }}
	{{ vProgress := uiutils.Def(p.Progress, "bar") }}
	{{ vLayout := uiutils.Def(p.Layout, "card") }}
	{{ vLandmarkLabel := p.LandmarkLabel }}
	if uiutils.Gt(uiutils.Len(vSteps), float64(0)) {
		@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: "section", Class: uiutils.S(uiutils.Cnv("mx-auto flex w-full max-w-lg flex-col gap-6 px-4 py-8", uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "card")), "rounded bg-card p-6 inset-ring inset-ring-border", ""))), Attrs: uiutils.Attrs("aria-labelledby", uiutils.Cond(uiutils.T(vLandmarkLabel), nil, uiutils.Tpl("{0}-title", vId)), "data-current", uiutils.Str(vCurrent), "aria-label", vLandmarkLabel, "data-slot", "wizard")}}) {
			@compose.Title(compose.TitleProps{As: uiutils.S(vLevel), Size: "2xl", Weight: "bold", TextProps: text.TextProps{Attrs: uiutils.Attrs("id", uiutils.Tpl("{0}-title", vId))}}) {
				{ uiutils.Text(vTitle) }
			}
			@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground", Attrs: uiutils.Attrs("data-slot", "step-of")}}) {
				{ uiutils.Text(uiutils.Tpl(uiutils.Get(vLabels, "stepOf"), vCurrent, uiutils.Len(vSteps))) }
			}
			if uiutils.Eq(vProgress, "bar") {
				@compose.Progress(compose.ProgressProps{ProgressProps: progress.ProgressProps{Value: uiutils.SP(uiutils.Str(vCurrent)), Max: uiutils.S(uiutils.Str(uiutils.Len(vSteps))), Attrs: uiutils.Attrs("aria-label", uiutils.Get(vLabels, "steps"))}})
			}
			if uiutils.Eq(vProgress, "list") {
				@compose.List(compose.ListProps{BoxProps: box.BoxProps{Class: "m-0 flex list-none flex-col gap-2 p-0", Attrs: uiutils.Attrs("aria-label", uiutils.Get(vLabels, "steps"), "data-slot", "step-list")}}) {
					for vI, vS := range uiutils.L(vSteps) {
						@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("flex items-center gap-4 text-sm", uiutils.Cond(uiutils.T(uiutils.Eq(uiutils.Add(float64(vI), float64(1)), vCurrent)), "font-semibold", "text-muted-foreground"))), Attrs: uiutils.Attrs("aria-current", uiutils.Cond(uiutils.T(uiutils.Eq(uiutils.Add(float64(vI), float64(1)), vCurrent)), "step", nil), "data-slot", "step-item")}}) {
							@icons.LucideIcon(icons.LucideIconProps{Name: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Lt(uiutils.Add(float64(vI), float64(1)), vCurrent)), "circle-check", uiutils.Get(vS, "icon"))), Size: 16})
							{ uiutils.Text(uiutils.Get(vS, "title")) }
						}
					}
				}
			}
			for vI, vS := range uiutils.L(vSteps) {
				if uiutils.Eq(uiutils.Add(float64(vI), float64(1)), vCurrent) {
					@compose.Stack(compose.StackProps{Gap: "4", Align: "stretch", BoxProps: box.BoxProps{Attrs: uiutils.Attrs("data-slot", "step")}}) {
						@compose.Title(compose.TitleProps{As: "3", Size: "xl", Weight: "bold", TextProps: text.TextProps{}}) {
							{ uiutils.Text(uiutils.Get(vS, "title")) }
						}
						@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
							{ uiutils.Text(uiutils.Get(vS, "text")) }
						}
						@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "grid gap-4"}}) {
							@Field(FieldProps{Label: uiutils.Get(vS, "fieldA"), HtmlFor: uiutils.Tpl("{0}-a", vId)}) {
								@compose.Input(compose.InputProps{InputProps: input.InputProps{Type: "text", Name: uiutils.S(uiutils.Tpl("{0}-a", vId)), Attrs: uiutils.Attrs("id", uiutils.Tpl("{0}-a", vId), "data-slot", "field")}})
							}
							@Field(FieldProps{Label: uiutils.Get(vS, "fieldB"), HtmlFor: uiutils.Tpl("{0}-b", vId)}) {
								@compose.Input(compose.InputProps{InputProps: input.InputProps{Type: "text", Name: uiutils.S(uiutils.Tpl("{0}-b", vId)), Attrs: uiutils.Attrs("id", uiutils.Tpl("{0}-b", vId), "data-slot", "field")}})
							}
						}
					}
				}
			}
			@compose.Group(compose.GroupProps{Gap: "2", Justify: "between", BoxProps: box.BoxProps{}}) {
				@compose.Button(compose.ButtonProps{Variant: "outline", Size: "default", ButtonProps: button.ButtonProps{Type: "button", Disabled: uiutils.T(uiutils.Lt(vCurrent, float64(2)))}}) {
					{ uiutils.Text(uiutils.Get(vLabels, "back")) }
				}
				@compose.Button(compose.ButtonProps{Variant: "default", Size: "default", ButtonProps: button.ButtonProps{Type: "button"}}) {
					{ uiutils.Text(uiutils.Cond(uiutils.T(uiutils.Ge(vCurrent, uiutils.Len(vSteps))), uiutils.Get(vLabels, "finish"), uiutils.Get(vLabels, "next"))) }
				}
			}
		}
	}
}

templ registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework twig --dir src --registry-url https://registry.buildy.tw/twig --strict-cdn
npx ui8kit add signup-wizard
blocks/signup-wizard.html.twig
{#- Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
    Source: packages/compose-gen/specs/organisms/signup-wizard.json
    A sign-up in steps: the progress, the fields of the current step, back and next. `current` is the step shown, counted from 1. Axes: progress (bar, list: every step named), layout (card, plain). Keeping the typed values between steps is the page's job.
    Props (p): id, title, steps, labels, current, level, progress, layout, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_steps = (p.steps ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_current = (p.current ?? 1) -%}
{%- set v_level = (p.level ?? 2) -%}
{%- set v_progress = (p.progress ?? 'bar') -%}
{%- set v_layout = (p.layout ?? 'card') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- if og_t(og_gt(og_len(v_steps), 0)) %}
  {%- set c_14 -%}
    {%- set c_1 -%}
      {{ og_text(v_title) }}
    {%- endset -%}
    {{ include('compose/Title.html.twig', {'as': og_i(v_level), 'size': '2xl', 'weight': 'bold', 'attrs': og_attrs(['id', og_tpl('{0}-title', [v_id])]), 'children': c_1}, with_context = false) }}
    {%- set c_2 -%}
      {{ og_text(og_tpl(og_get(v_labels, ['stepOf']), [v_current, og_len(v_steps)])) }}
    {%- endset -%}
    {{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'attrs': og_attrs(['data-slot', 'step-of']), 'children': c_2}, with_context = false) }}
    {%- if og_t(og_eq(v_progress, 'bar')) %}
      {{ include('compose/Progress.html.twig', {'value': og_s(og_str(v_current)), 'max': og_s(og_str(og_len(v_steps))), 'attrs': og_attrs(['aria-label', og_get(v_labels, ['steps'])])}, with_context = false) }}
    {%- endif %}
    {%- if og_t(og_eq(v_progress, 'list')) %}
      {%- set c_4 -%}
        {%- for v_s in og_l(v_steps) %}
          {%- set v_i = loop.index0 -%}
          {%- set c_3 -%}
            {{ include('icons/LucideIcon.html.twig', {'name': og_s((og_t(og_lt(og_add(v_i, 1), v_current)) ? 'circle-check' : og_get(v_s, ['icon']))), 'size': 16}, with_context = false) }}
            {{ og_text(og_get(v_s, ['title'])) }}
          {%- endset -%}
          {{ include('compose/ListItem.html.twig', {'class': og_s(og_cnv(['flex items-center gap-4 text-sm', (og_t(og_eq(og_add(v_i, 1), v_current)) ? 'font-semibold' : 'text-muted-foreground')])), 'attrs': og_attrs(['aria-current', (og_t(og_eq(og_add(v_i, 1), v_current)) ? 'step' : null), 'data-slot', 'step-item']), 'children': c_3}, with_context = false) }}
        {%- endfor %}
      {%- endset -%}
      {{ include('compose/List.html.twig', {'class': 'm-0 flex list-none flex-col gap-2 p-0', 'attrs': og_attrs(['aria-label', og_get(v_labels, ['steps']), 'data-slot', 'step-list']), 'children': c_4}, with_context = false) }}
    {%- endif %}
    {%- for v_s in og_l(v_steps) %}
      {%- set v_i = loop.index0 -%}
      {%- if og_t(og_eq(og_add(v_i, 1), v_current)) %}
        {%- set c_10 -%}
          {%- set c_5 -%}
            {{ og_text(og_get(v_s, ['title'])) }}
          {%- endset -%}
          {{ include('compose/Title.html.twig', {'as': 3, 'size': 'xl', 'weight': 'bold', 'children': c_5}, with_context = false) }}
          {%- set c_6 -%}
            {{ og_text(og_get(v_s, ['text'])) }}
          {%- endset -%}
          {{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'children': c_6}, with_context = false) }}
          {%- set c_9 -%}
            {%- set c_7 -%}
              {{ include('compose/Input.html.twig', {'type': 'text', 'name': og_s(og_tpl('{0}-a', [v_id])), 'attrs': og_attrs(['id', og_tpl('{0}-a', [v_id]), 'data-slot', 'field'])}, with_context = false) }}
            {%- endset -%}
            {{ include('blocks/field.html.twig', {'p': {'label': og_get(v_s, ['fieldA']), 'htmlFor': og_tpl('{0}-a', [v_id])}, 'children': og_markup(c_7)}, with_context = false) }}
            {%- set c_8 -%}
              {{ include('compose/Input.html.twig', {'type': 'text', 'name': og_s(og_tpl('{0}-b', [v_id])), 'attrs': og_attrs(['id', og_tpl('{0}-b', [v_id]), 'data-slot', 'field'])}, with_context = false) }}
            {%- endset -%}
            {{ include('blocks/field.html.twig', {'p': {'label': og_get(v_s, ['fieldB']), 'htmlFor': og_tpl('{0}-b', [v_id])}, 'children': og_markup(c_8)}, with_context = false) }}
          {%- endset -%}
          {{ include('compose/Box.html.twig', {'class': 'grid gap-4', 'children': c_9}, with_context = false) }}
        {%- endset -%}
        {{ include('compose/Stack.html.twig', {'gap': '4', 'align': 'stretch', 'attrs': og_attrs(['data-slot', 'step']), 'children': c_10}, with_context = false) }}
      {%- endif %}
    {%- endfor %}
    {%- set c_13 -%}
      {%- set c_11 -%}
        {{ og_text(og_get(v_labels, ['back'])) }}
      {%- endset -%}
      {{ include('compose/Button.html.twig', {'variant': 'outline', 'size': 'default', 'type': 'button', 'disabled': og_t(og_lt(v_current, 2)), 'children': c_11}, with_context = false) }}
      {%- set c_12 -%}
        {{ og_text((og_t(og_ge(v_current, og_len(v_steps))) ? og_get(v_labels, ['finish']) : og_get(v_labels, ['next']))) }}
      {%- endset -%}
      {{ include('compose/Button.html.twig', {'variant': 'default', 'size': 'default', 'type': 'button', 'children': c_12}, with_context = false) }}
    {%- endset -%}
    {{ include('compose/Group.html.twig', {'gap': '2', 'justify': 'between', 'children': c_13}, with_context = false) }}
  {%- endset -%}
  {{ include('compose/Block.html.twig', {'tag': 'section', 'class': og_s(og_cnv(['mx-auto flex w-full max-w-lg flex-col gap-6 px-4 py-8', (og_t(og_eq(v_layout, 'card')) ? 'rounded bg-card p-6 inset-ring inset-ring-border' : '')])), 'attrs': og_attrs(['aria-labelledby', (og_t(v_landmarkLabel) ? null : og_tpl('{0}-title', [v_id])), 'data-current', og_str(v_current), 'aria-label', v_landmarkLabel, 'data-slot', 'wizard']), 'children': c_14}, with_context = false) }}
{%- endif %}

Twig registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework latte --dir src --registry-url https://registry.buildy.tw/latte --strict-cdn
npx ui8kit add signup-wizard
blocks/signup-wizard.latte
{* Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
    Source: packages/compose-gen/specs/organisms/signup-wizard.json
    A sign-up in steps: the progress, the fields of the current step, back and next. `current` is the step shown, counted from 1. Axes: progress (bar, list: every step named), layout (card, plain). Keeping the typed values between steps is the page's job.
    Props (p): id, title, steps, labels, current, level, progress, layout, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_steps = ($p['steps'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_current = ($p['current'] ?? 1)}
{var $v_level = ($p['level'] ?? 2)}
{var $v_progress = ($p['progress'] ?? 'bar')}
{var $v_layout = ($p['layout'] ?? 'card')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{if og_t(og_gt(og_len($v_steps), 0))}
  {capture $c_14}
    {capture $c_1}
      {=og_text($v_title)}
    {/capture}
    {=og_include('compose/Title.latte', ['as' => og_i($v_level), 'size' => '2xl', 'weight' => 'bold', 'attrs' => og_attrs(['id', og_tpl('{0}-title', [$v_id])]), 'children' => (string) $c_1])|noescape}
    {capture $c_2}
      {=og_text(og_tpl(og_get($v_labels, ['stepOf']), [$v_current, og_len($v_steps)]))}
    {/capture}
    {=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'attrs' => og_attrs(['data-slot', 'step-of']), 'children' => (string) $c_2])|noescape}
    {if og_t(og_eq($v_progress, 'bar'))}
      {=og_include('compose/Progress.latte', ['value' => og_s(og_str($v_current)), 'max' => og_s(og_str(og_len($v_steps))), 'attrs' => og_attrs(['aria-label', og_get($v_labels, ['steps'])])])|noescape}
    {/if}
    {if og_t(og_eq($v_progress, 'list'))}
      {capture $c_4}
        {foreach og_l($v_steps) as $v_s}
          {var $v_i = $iterator->counter0}
          {capture $c_3}
            {=og_include('icons/LucideIcon.latte', ['name' => og_s((og_t(og_lt(og_add($v_i, 1), $v_current)) ? 'circle-check' : og_get($v_s, ['icon']))), 'size' => 16])|noescape}
            {=og_text(og_get($v_s, ['title']))}
          {/capture}
          {=og_include('compose/ListItem.latte', ['class' => og_s(og_cnv(['flex items-center gap-4 text-sm', (og_t(og_eq(og_add($v_i, 1), $v_current)) ? 'font-semibold' : 'text-muted-foreground')])), 'attrs' => og_attrs(['aria-current', (og_t(og_eq(og_add($v_i, 1), $v_current)) ? 'step' : null), 'data-slot', 'step-item']), 'children' => (string) $c_3])|noescape}
        {/foreach}
      {/capture}
      {=og_include('compose/List.latte', ['class' => 'm-0 flex list-none flex-col gap-2 p-0', 'attrs' => og_attrs(['aria-label', og_get($v_labels, ['steps']), 'data-slot', 'step-list']), 'children' => (string) $c_4])|noescape}
    {/if}
    {foreach og_l($v_steps) as $v_s}
      {var $v_i = $iterator->counter0}
      {if og_t(og_eq(og_add($v_i, 1), $v_current))}
        {capture $c_10}
          {capture $c_5}
            {=og_text(og_get($v_s, ['title']))}
          {/capture}
          {=og_include('compose/Title.latte', ['as' => 3, 'size' => 'xl', 'weight' => 'bold', 'children' => (string) $c_5])|noescape}
          {capture $c_6}
            {=og_text(og_get($v_s, ['text']))}
          {/capture}
          {=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'children' => (string) $c_6])|noescape}
          {capture $c_9}
            {capture $c_7}
              {=og_include('compose/Input.latte', ['type' => 'text', 'name' => og_s(og_tpl('{0}-a', [$v_id])), 'attrs' => og_attrs(['id', og_tpl('{0}-a', [$v_id]), 'data-slot', 'field'])])|noescape}
            {/capture}
            {=og_include('blocks/field.latte', ['p' => ['label' => og_get($v_s, ['fieldA']), 'htmlFor' => og_tpl('{0}-a', [$v_id])], 'children' => og_markup($c_7)])|noescape}
            {capture $c_8}
              {=og_include('compose/Input.latte', ['type' => 'text', 'name' => og_s(og_tpl('{0}-b', [$v_id])), 'attrs' => og_attrs(['id', og_tpl('{0}-b', [$v_id]), 'data-slot', 'field'])])|noescape}
            {/capture}
            {=og_include('blocks/field.latte', ['p' => ['label' => og_get($v_s, ['fieldB']), 'htmlFor' => og_tpl('{0}-b', [$v_id])], 'children' => og_markup($c_8)])|noescape}
          {/capture}
          {=og_include('compose/Box.latte', ['class' => 'grid gap-4', 'children' => (string) $c_9])|noescape}
        {/capture}
        {=og_include('compose/Stack.latte', ['gap' => '4', 'align' => 'stretch', 'attrs' => og_attrs(['data-slot', 'step']), 'children' => (string) $c_10])|noescape}
      {/if}
    {/foreach}
    {capture $c_13}
      {capture $c_11}
        {=og_text(og_get($v_labels, ['back']))}
      {/capture}
      {=og_include('compose/Button.latte', ['variant' => 'outline', 'size' => 'default', 'type' => 'button', 'disabled' => og_t(og_lt($v_current, 2)), 'children' => (string) $c_11])|noescape}
      {capture $c_12}
        {=og_text((og_t(og_ge($v_current, og_len($v_steps))) ? og_get($v_labels, ['finish']) : og_get($v_labels, ['next'])))}
      {/capture}
      {=og_include('compose/Button.latte', ['variant' => 'default', 'size' => 'default', 'type' => 'button', 'children' => (string) $c_12])|noescape}
    {/capture}
    {=og_include('compose/Group.latte', ['gap' => '2', 'justify' => 'between', 'children' => (string) $c_13])|noescape}
  {/capture}
  {=og_include('compose/Block.latte', ['tag' => 'section', 'class' => og_s(og_cnv(['mx-auto flex w-full max-w-lg flex-col gap-6 px-4 py-8', (og_t(og_eq($v_layout, 'card')) ? 'rounded bg-card p-6 inset-ring inset-ring-border' : '')])), 'attrs' => og_attrs(['aria-labelledby', (og_t($v_landmarkLabel) ? null : og_tpl('{0}-title', [$v_id])), 'data-current', og_str($v_current), 'aria-label', $v_landmarkLabel, 'data-slot', 'wizard']), 'children' => (string) $c_14])|noescape}
{/if}

Latte registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework jinja2 --dir src --registry-url https://registry.buildy.tw/jinja2 --strict-cdn
npx ui8kit add signup-wizard
blocks/signup-wizard.html.j2
{#- Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
    Source: packages/compose-gen/specs/organisms/signup-wizard.json
    A sign-up in steps: the progress, the fields of the current step, back and next. `current` is the step shown, counted from 1. Axes: progress (bar, list: every step named), layout (card, plain). Keeping the typed values between steps is the page's job.
    Props (p): id, title, steps, labels, current, level, progress, layout, landmarkLabel. -#}
{%- set v_id = og_def(p['id'], none) -%}
{%- set v_title = og_def(p['title'], none) -%}
{%- set v_steps = og_def(p['steps'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set v_current = og_def(p['current'], 1) -%}
{%- set v_level = og_def(p['level'], 2) -%}
{%- set v_progress = og_def(p['progress'], 'bar') -%}
{%- set v_layout = og_def(p['layout'], 'card') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- if og_t(og_gt(og_len(v_steps), 0)) %}
  {%- set c_14 -%}
    {%- set c_1 -%}
      {{ og_text(v_title) }}
    {%- endset -%}
    {{ og_include('compose/title.html.j2', {'p': {'As': og_i(v_level), 'Size': '2xl', 'Weight': 'bold', 'Attrs': og_attrs(['id', og_tpl('{0}-title', [v_id])])}, 'children': c_1}) }}
    {%- set c_2 -%}
      {{ og_text(og_tpl(og_get(v_labels, ['stepOf']), [v_current, og_len(v_steps)])) }}
    {%- endset -%}
    {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground', 'Attrs': og_attrs(['data-slot', 'step-of'])}, 'children': c_2}) }}
    {%- if og_t(og_eq(v_progress, 'bar')) %}
      {{ og_include('compose/progress.html.j2', {'p': {'Value': og_s(og_str(v_current)), 'Max': og_s(og_str(og_len(v_steps))), 'Attrs': og_attrs(['aria-label', og_get(v_labels, ['steps'])])}}) }}
    {%- endif %}
    {%- if og_t(og_eq(v_progress, 'list')) %}
      {%- set c_4 -%}
        {%- for v_s in og_l(v_steps) %}
          {%- set v_i = loop.index0 -%}
          {%- set c_3 -%}
            {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': og_s(('circle-check' if og_t(og_lt(og_add(v_i, 1), v_current)) else og_get(v_s, ['icon']))), 'Size': 16}}) }}
            {{ og_text(og_get(v_s, ['title'])) }}
          {%- endset -%}
          {{ og_include('compose/list-item.html.j2', {'p': {'Class': og_s(og_cnv(['flex items-center gap-4 text-sm', ('font-semibold' if og_t(og_eq(og_add(v_i, 1), v_current)) else 'text-muted-foreground')])), 'Attrs': og_attrs(['aria-current', ('step' if og_t(og_eq(og_add(v_i, 1), v_current)) else none), 'data-slot', 'step-item'])}, 'children': c_3}) }}
        {%- endfor %}
      {%- endset -%}
      {{ og_include('compose/list.html.j2', {'p': {'Class': 'm-0 flex list-none flex-col gap-2 p-0', 'Attrs': og_attrs(['aria-label', og_get(v_labels, ['steps']), 'data-slot', 'step-list'])}, 'children': c_4}) }}
    {%- endif %}
    {%- for v_s in og_l(v_steps) %}
      {%- set v_i = loop.index0 -%}
      {%- if og_t(og_eq(og_add(v_i, 1), v_current)) %}
        {%- set c_10 -%}
          {%- set c_5 -%}
            {{ og_text(og_get(v_s, ['title'])) }}
          {%- endset -%}
          {{ og_include('compose/title.html.j2', {'p': {'As': 3, 'Size': 'xl', 'Weight': 'bold'}, 'children': c_5}) }}
          {%- set c_6 -%}
            {{ og_text(og_get(v_s, ['text'])) }}
          {%- endset -%}
          {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_6}) }}
          {%- set c_9 -%}
            {%- set c_7 -%}
              {{ og_include('compose/input.html.j2', {'p': {'Type': 'text', 'Name': og_s(og_tpl('{0}-a', [v_id])), 'Attrs': og_attrs(['id', og_tpl('{0}-a', [v_id]), 'data-slot', 'field'])}}) }}
            {%- endset -%}
            {{ og_include('blocks/field.html.j2', {'p': {'label': og_get(v_s, ['fieldA']), 'htmlFor': og_tpl('{0}-a', [v_id])}, 'children': og_markup(c_7)}) }}
            {%- set c_8 -%}
              {{ og_include('compose/input.html.j2', {'p': {'Type': 'text', 'Name': og_s(og_tpl('{0}-b', [v_id])), 'Attrs': og_attrs(['id', og_tpl('{0}-b', [v_id]), 'data-slot', 'field'])}}) }}
            {%- endset -%}
            {{ og_include('blocks/field.html.j2', {'p': {'label': og_get(v_s, ['fieldB']), 'htmlFor': og_tpl('{0}-b', [v_id])}, 'children': og_markup(c_8)}) }}
          {%- endset -%}
          {{ og_include('compose/box.html.j2', {'p': {'Class': 'grid gap-4'}, 'children': c_9}) }}
        {%- endset -%}
        {{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Attrs': og_attrs(['data-slot', 'step'])}, 'children': c_10}) }}
      {%- endif %}
    {%- endfor %}
    {%- set c_13 -%}
      {%- set c_11 -%}
        {{ og_text(og_get(v_labels, ['back'])) }}
      {%- endset -%}
      {{ og_include('compose/button.html.j2', {'p': {'Variant': 'outline', 'Size': 'default', 'Type': 'button', 'Disabled': og_t(og_lt(v_current, 2))}, 'children': c_11}) }}
      {%- set c_12 -%}
        {{ og_text((og_get(v_labels, ['finish']) if og_t(og_ge(v_current, og_len(v_steps))) else og_get(v_labels, ['next']))) }}
      {%- endset -%}
      {{ og_include('compose/button.html.j2', {'p': {'Variant': 'default', 'Size': 'default', 'Type': 'button'}, 'children': c_12}) }}
    {%- endset -%}
    {{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Justify': 'between'}, 'children': c_13}) }}
  {%- endset -%}
  {{ og_include('compose/block.html.j2', {'p': {'Tag': 'section', 'Class': og_s(og_cnv(['mx-auto flex w-full max-w-lg flex-col gap-6 px-4 py-8', ('rounded bg-card p-6 inset-ring inset-ring-border' if og_t(og_eq(v_layout, 'card')) else '')])), 'Attrs': og_attrs(['aria-labelledby', (none if og_t(v_landmarkLabel) else og_tpl('{0}-title', [v_id])), 'data-current', og_str(v_current), 'aria-label', v_landmarkLabel, 'data-slot', 'wizard'])}, 'children': c_14}) }}
{%- endif %}

Jinja2 registry item (JSON)

Props

Names and types come from the xgen specs of the source. Standard HTML attributes (id, role, tabIndex, aria-*) pass through to the root element; the class prop is className in React.

A sign-up in steps: the progress, the fields of the current step, back and next. `current` is the step shown, counted from 1. Axes: progress (bar, list: every step named), layout (card, plain). Keeping the typed values between steps is the page's job.

Props of SignupWizard
PropTypeDefault Description
id (required)string-
title (required)string-
steps (required)WizardStep[]-
labels (required)WizardLabels-
current number1
level 1 | 22
progress "bar" | "list""bar"
layout "card" | "plain""card"
landmarkLabel string-accessible name of the landmark of this component when the page shows it more than once (a variant); replaces the heading name of the root landmark, follows the name of a nested one