step rogress bootstrap stepper - Download Create Step By Step Progress In Bootstrap 4 - bs-stepper

Download Create Step By Step Progress In Bootstrap 4 – bs-stepper

Posted on

This time I will share jQuery Plugin and tutorial about Create Step By Step Progress In Bootstrap 4 – bs-stepper, hope it will help you in programming stack.

step rogress bootstrap stepper - Download Create Step By Step Progress In Bootstrap 4 - bs-stepper
File Size: 119 KB
Views Total: 48978
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

bs-stepper is a lightweight stepper JavaScript plugin for Bootstrap 4 that helps you create wizard-style step-by-step progresses for forms, guides, and installations.

How to use it:

1. Install the bs-stepper plugin.

1 # NPM
2 $ npm install bs-stepper --save

2. Import the bs-stepper.

1 import Stepper from 'bs-stepper'

3. Or include the bs-stepper’s files from a CDN.

4. The HTML structure to create a basic stepper containing 3 steps and next/prev buttons.

01 <div id="stepper-example" class="bs-stepper">
02   <div class="bs-stepper-header">
03     <div class="step" data-target="#test-l-1">
04       <a href="#">
05         <span class="bs-stepper-circle">1</span>
06         <span class="bs-stepper-label">First step</span>
07       </a>
08     </div>
09     <div class="line"></div>
10     <div class="step" data-target="#test-l-2">
11       <a href="#">
12         <span class="bs-stepper-circle">2</span>
13         <span class="bs-stepper-label">Second step</span>
14       </a>
15     </div>
16     <div class="line"></div>
17     <div class="step" data-target="#test-l-3">
18       <a href="#">
19         <span class="bs-stepper-circle">3</span>
20         <span class="bs-stepper-label">Third step</span>
21       </a>
22     </div>
23   </div>
24   <div class="bs-stepper-content">
25     <div id="test-l-1" class="content">
26       <p class="text-center">test 1</p>
27       <button class="btn btn-primary" onclick="myStepper.next()">Next</button>
28     </div>
29     <div id="test-l-2" class="content">
30       <p class="text-center">test 2</p>
31       <button class="btn btn-primary" onclick="myStepper.next()">Next</button>
32     </div>
33     <div id="test-l-3" class="content">
34       <p class="text-center">test 3</p>
35       <button class="btn btn-primary" onclick="myStepper.next()">Next</button>
36       <button class="btn btn-primary" onclick="myStepper.previous()">Previous</button>
37     </div>
38   </div>
39 </div>

5. Initialize the stepper by calling the function on the top container.

1 // Vanilla JavaScript
2 document.addEventListener('DOMContentLoaded', function () {
3   myStepper = new Stepper(document.querySelector('#stepper-example'))
4 })
5  
6 // As a jQuery Plugin
7 $(document).ready(function () {
8   var myStepper = new Stepper($('#stepper-example'))
9 })

6. To create a non-linear stepper where the users are able to back to the previous step:

1 myStepper = new Stepper(document.querySelector('#stepper-example'),{
2   linear: false
3 })

7. Enable/disable the fade animation:

1 myStepper = new Stepper(document.querySelector('#stepper-example'),{
2   animation: true
3 })

8. To create a vertical stepper, just add the vertical class to the top container.

1 <div id="example" class="bs-stepper vertical">
2   ...
3 </div>

Changelog:

v1.7.0 (2019-07-24)

  • Bugfix
  • Add from and to properties in events detail

v1.6.0/v1.6.1 (2019-06-19)

  • Allows you to customize stepper internal css classes
  • Bugfixes

v1.5.0 (2019-03-22)

  • events: dispatch show events (show and shown)

v1.4.1 (2019-03-22)

  • selector: remove a selector
  • selector: simple tags won’t trigger step change, you have to use .step-trigger to allow that
  • feat(events): dispatch show events (show and shown)

v1.3.0 (2019-02-25)

  • feat(core): rewrite css smartly

v1.3.0 (2019-02-05)

  • Bugfixes

v1.2.0 (2018-10-22)

  • feat(core): add vertical stepper

2018-10-16

  • add fade effect
  • add d-none by default for fade steppers
  • fix code style

This awesome jQuery plugin is developed by Johann-S. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net