# Steps >> Use Cases ||20 ```js script import { html } from '@mdjs/mdjs-preview'; import '@lion/steps/define'; import '@lion/steps/define'; ``` ```js preview-story export const main = () => html`

Welcome

 

Are you single?

 

You are single

 

You are NOT single.

 

Finish

`; ``` ## Define steps We provide two components: `lion-steps` and `lion-step`. Steps need to be direct children of `lion-steps`. ```html Step 1 Step 2 ...... Step N ``` The first step needs to be explicitly set via `initial-step` so that it get status `entered`, while others are `untouched` by default. You can navigate between steps using `next()` and `previous()` methods, so that next step gets `entered` status, while previous one becomes `left`: ```js next() { return this.shadowRoot.getElementById('steps').next(); } previous() { return this.shadowRoot.getElementById('steps').previous(); } ``` ## Conditions You can provide a condition to a step (with or without `invert-condition` emulating if-else flow): ```html ... step where `data.smth` is set if else ... ``` If a condition was not met a step gets a status `skipped`. ## Forward only steps If you have an intermediate step loading data via AJAX request and then automatically calling `next()`, you can flag it as `forward-only`. This will ensure that navigation to the previous step is possible and does not lead to another AJAX request which leads to next step again, breaking the flow for a user. ```html preliminary step data is loaded and next() is called automatically afterwards do smth with data ``` ## Events If you need to be notified when transition between steps occurs use the `transition` event by providing steps data: ```html Step 1 Step 2 Step 3 ``` For notifications about specific step status change you can use individual events like this: ```html Step 1 Step 2 Step 3 ```