UI Elements

ProgressTracker

A component that displays the current step in a multi-step process or workflow.

  1. (1)
    Step 1
  2. (2)
    Step 2
  3. (3)
    Step 3

Anatomy

The class attribute values represent part names, and conditional indicates elements that are rendered conditionally. Other attributes represent their corresponding props.

Svelte
<ol class="whole">
  {#each labels as label}
    <li class="middle">
      <div class="main">
        <div class="aux" conditional>{aux}</div>
        <div class="label">{label} or {children}</div>
      </div>
      <div class="extra" conditional>{extra}</div>
    </li>
  {/each}
</ol>

Props

Type

(value) indicates the default value for the prop.

TypeScript
interface ProgressTrackerProps {
  current: number; // bindable (0)
  labels: string[];
  children?: Snippet<[number, string, string]>; // Snippet<[index,label,variant]>
  aux?: Snippet<[number, string, string]>; // Snippet<[index,label,variant]>
  extra?: boolean | Snippet<[number, string, string]>; // (true) Snippet<[index,label,variant]>
  styling?: SVSClass;
  variant?: string; // bindable (VARIANT.NEUTRAL)
  eachVariant?: SvelteMap<number, string> | Map<number, string>;
}

Additional Props

  • current - Index of the steps currently progressing
  • eachVariant - Specify a variant for each step

Styling

To learn more, see Styling.

Variant Management

Current step and whole part are applied neutral. Steps less than current step will be active, greater than current will be inactive. If the variant prop is specified, the specified value is applied instead of neutral.

Default Class Name

svs-progress-tracker

Exports

Types

TypeScript
type ProgressTrackerReqdProps = "current" | "labels";
type ProgressTrackerBindProps = "current" | "variant";

Others

No additional exports are available.

Examples

The example code uses Tailwind CSS along with SVSClass.

Basic

  1. (1)
    Step 1
  2. (2)
    Step 2
  3. (3)
    Step 3

With Interactive Variant

Preset for Demo
Enter variant as you like
  1. Step 1
    Additional text 1
  2. Step 2
    Additional text 2
  3. Step 3
    Additional text 3
  4. Step 4
    Additional text 4