Module: AlpineSteps

A controller for stepwise UI components.

Source:

Classes

StepsController

Methods

(inner) StepsComponent(model, circular, initialStep) → {StepsControllerObject}

Callback function for building a steps controller as a plain js object.

Usage Example

Parameters:
Name Type Description
model Array.<string> | Array.<Object>

Step items.

circular boolean

Allow circular step indexing.

initialStep string

Name of step to start with.

Source:
Returns:

A StepsControllerObject object

Type
StepsControllerObject

Type Definitions

StepsControllerObject

StepsController as a plain js object.

Type:
  • Object
Properties:
Name Type Description
steps Array.<string> | Array.<Object>

Step items.

currentStep string

The name of the active step item.

circular boolean

If circular indexing is enabled.

length number

The length of the steps items.

currentStepIndex number

1 based index of active step.

currentIndex number

0 based index of active step.

firstStepName string

Name of first step item.

currentStepNode string | Object

The active step item.

isActive function

Validate if step is active by name.

transitionTo function

Activate step by name.

transitionToNext function

Activate the next step.

transitionToPrevious function

Activate the previous step.

activate function

Set current step by name.

pickNext function

Get the next available step item.

pickPrevious function

Get the previous available step item.

incrementIndex function

Increment the index.

getIndex function

Get the 1 based index of the step by name.

init function

Required by Alpine for automatic execution.

Source: