@lion/steps
TypeScript icon, indicating that this package has built-in type declarations

0.12.1 • Public • Published

Steps >> Overview ||10

A web component that can be used to break a single goal down into dependable sub-tasks.

import { html } from '@mdjs/mdjs-preview';
import '@lion/steps/define';
export const main = () => html`
  <lion-steps>
    <lion-step initial-step>
      Step 1
      <button type="button" @click=${ev => ev.target.parentElement.controller.next()}>Next</button>
    </lion-step>
    <lion-step>
      <button type="button" @click=${ev => ev.target.parentElement.controller.previous()}>
        Previous
      </button>
      Step 2
      <button type="button" @click=${ev => ev.target.parentElement.controller.next()}>
        Next
      </button></lion-step
    >
    <lion-step>
      <button type="button" @click=${ev => ev.target.parentElement.controller.previous()}>
        Previous
      </button>
      Step 3
    </lion-step>
  </lion-steps>
`;

Features

  • navigate between different steps with 'previous' and 'next' functions.
  • keeps status of each step
    • untouched
    • entered
    • left
    • skipped
  • options
    • initial-step: Set to the first step of the flow, blocks calling previous function.
    • condition: Dynamic condition, when true the step is added to the flow.
    • invert-condition: Inverts the condition set.

In many application you build multi-step workflows like multi-step forms where you want to split a long process into smaller steps making the user's perception of it and filling in data easier. The idea of this component is to provide a simple way to define such steps and transition from one step to another while saving data between them and to conditionally skip some steps based on the data.

Installation

npm i --save @lion/steps
import { LionSteps, LionStep } from '@lion/steps';
// or
import '@lion/steps/define';

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.12.1
    8
    • latest
  • 0.8.7
    2
    • lit1

Version History

Package Sidebar

Install

npm i @lion/steps

Weekly Downloads

966

Version

0.12.1

License

MIT

Unpacked Size

60.6 kB

Total Files

21

Last publish

Collaborators

  • tlouisse
  • narzac
  • d4kmor