← All @molecule/* packages · App templates
@molecule/app-stepper-defaultProvider bond · stepper · App (browser) · v1.0.1 · Apache-2.0
Default provider for @molecule/app-stepper
npm install @molecule/app-stepper-defaultnpm · Source on GitHub · Implements @molecule/app-stepper
@molecule/app-stepper-default is a provider bond on the app (browser) side: it implements the stepper core interface (@molecule/app-stepper) with a concrete vendor or library behind it.
Your code calls the core; you wire this provider once at startup. Swapping vendors later is one line in that wiring, not a rewrite.
import { setProvider, requireProvider } from '@molecule/app-stepper'
import { provider } from '@molecule/app-stepper-default'
setProvider(provider)
const steps = [
{ id: 'account', label: 'Account', completed: false },
{ id: 'profile', label: 'Profile', completed: false },
{ id: 'review', label: 'Review', completed: false, optional: true },
]
const stepper = requireProvider().createStepper({
steps,
linear: true,
onStepChange: (i) => render(i),
})
// Linear mode reads YOUR step objects: mark the current one complete to unlock next().
steps[stepper.getActiveStep()].completed = true
stepper.next()Works with: @molecule/app-stepper
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Default provider for @molecule/app-stepper.
In-memory, headless stepper: step navigation (next/previous/goTo),
linear-mode gating, and completion tracking. No DOM, no styling — the app
renders the step UI and drives this state machine.
import { setProvider, requireProvider } from '@molecule/app-stepper'
import { provider } from '@molecule/app-stepper-default'
setProvider(provider)
const steps = [
{ id: 'account', label: 'Account', completed: false },
{ id: 'profile', label: 'Profile', completed: false },
{ id: 'review', label: 'Review', completed: false, optional: true },
]
const stepper = requireProvider().createStepper({
steps,
linear: true,
onStepChange: (i) => render(i),
})
// Linear mode reads YOUR step objects: mark the current one complete to unlock next().
steps[stepper.getActiveStep()].completed = true
stepper.next()
provider
npm install @molecule/app-stepper-default @molecule/app-stepper
DefaultStepperConfigProvider-specific configuration options.
interface DefaultStepperConfig {
/** Currently not implemented — orientation is a rendering concern the app owns. */
orientation?: 'horizontal' | 'vertical'
}
createProvider(_config)Creates a default stepper provider.
function createProvider(_config?: DefaultStepperConfig): StepperProvider
_config — Optional provider configuration.Returns: A configured StepperProvider.
providerDefault stepper provider instance.
const provider: StepperProvider
Implements @molecule/app-stepper interface.
Setup function to register this provider with the core interface:
import { setProvider } from '@molecule/app-stepper'
import { provider } from '@molecule/app-stepper-default'
export function setupStepperDefault(): void {
setProvider(provider)
}
Peer dependencies:
@molecule/app-stepper ^1.0.1@molecule/app-stepper
Wire it with setProvider() from @molecule/app-stepper or
bond('stepper', provider) from @molecule/app-bond — both route through the
shared registry (the core was migrated off its old module-local singleton);
requireProvider() throws until one has run.
Headless — the provider owns navigation state only; the app owns all rendering (step indicators, content, buttons).
There is no "complete step" method. The instance shares your step objects:
set step.completed = true (or optional: true) on the objects you passed to
createStepper — linear next()/goTo() gate on those flags.
Blocked navigation is a SILENT no-op (linear gating, out-of-range goTo) — no
error and no onStepChange call; check getActiveStep() if you need to detect it.
validate() only checks the current step's error flag; isComplete() requires
every non-optional step completed.
Integration checklist — drive the real rendered wizard in the live preview (no mocks), adapt each item to this app's actual steps/screens, and check every box off one by one. A box you can't check is an integration bug to fix — not a skip:
steps
config and getActiveStep().optional,
by contrast, CAN be advanced past without completing it.linear stepper refuses to jump ahead — clicking an unreached
future step in the indicator (or goTo(futureIndex)) does nothing and the
active step stays put; you reach it only by completing the steps before
it. A non-linear stepper lets you navigate directly to any step.isComplete() is true — the
wizard doesn't advance past the end.