{"id":13808417,"url":"https://github.com/Johann-S/bs-stepper","last_synced_at":"2025-05-14T02:31:51.334Z","repository":{"id":33132440,"uuid":"152484909","full_name":"Johann-S/bs-stepper","owner":"Johann-S","description":"A stepper for Bootstrap 4.x","archived":false,"fork":false,"pushed_at":"2024-03-10T10:23:13.000Z","size":2211,"stargazers_count":448,"open_issues_count":67,"forks_count":89,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-11T21:37:38.044Z","etag":null,"topics":["bootstrap","bootstrap-4","bootstrap4","css","css3","stepper","vanilla-javascript","vanilla-js","vanillajs"],"latest_commit_sha":null,"homepage":"https://johann-s.github.io/bs-stepper/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Johann-S.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"jservoire","liberapay":"Johann-S","custom":"https://www.paypal.me/jservoire"}},"created_at":"2018-10-10T20:21:56.000Z","updated_at":"2024-10-21T11:52:18.000Z","dependencies_parsed_at":"2024-06-18T12:28:20.386Z","dependency_job_id":"21263451-0d00-45a7-b4d8-a4fa525ea2d0","html_url":"https://github.com/Johann-S/bs-stepper","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Johann-S%2Fbs-stepper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Johann-S%2Fbs-stepper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Johann-S%2Fbs-stepper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Johann-S%2Fbs-stepper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Johann-S","download_url":"https://codeload.github.com/Johann-S/bs-stepper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225273237,"owners_count":17448073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","bootstrap-4","bootstrap4","css","css3","stepper","vanilla-javascript","vanilla-js","vanillajs"],"created_at":"2024-08-04T01:01:42.308Z","updated_at":"2024-11-19T00:30:45.437Z","avatar_url":"https://github.com/Johann-S.png","language":"JavaScript","funding_links":["https://patreon.com/jservoire","https://liberapay.com/Johann-S","https://www.paypal.me/jservoire","https://www.patreon.com/jservoire"],"categories":["JavaScript"],"sub_categories":[],"readme":"# bs-stepper\n\n[![npm version](https://img.shields.io/npm/v/bs-stepper.svg)](https://www.npmjs.com/package/bs-stepper)\n[![dependencies Status](https://img.shields.io/david/Johann-S/bs-stepper.svg)](https://david-dm.org/Johann-S/bs-stepper)\n[![devDependencies Status](https://img.shields.io/david/dev/Johann-S/bs-stepper.svg)](https://david-dm.org/Johann-S/bs-stepper?type=dev)\n[![Build Status](https://github.com/Johann-S/bs-stepper/workflows/Tests/badge.svg)](https://github.com/Johann-S/bs-stepper/actions?workflow=Tests)\n[![Coverage Status](https://img.shields.io/coveralls/github/Johann-S/bs-stepper/master.svg)](https://coveralls.io/github/Johann-S/bs-stepper?branch=master)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com/)\n[![JS gzip size](https://img.badgesize.io/Johann-S/bs-stepper/gh-pages/dist/js/bs-stepper.min.js?compression=gzip\u0026label=JS+gzip+size)](https://github.com/Johann-S/bs-stepper/tree/gh-pages/dist/js/bs-stepper.min.js)\n[![CSS gzip size](https://img.badgesize.io/Johann-S/bs-stepper/gh-pages/dist/css/bs-stepper.min.css?compression=gzip\u0026label=CSS+gzip+size)](https://github.com/Johann-S/bs-stepper/tree/gh-pages/dist/css/bs-stepper.min.css)\n\nA stepper plugin for Bootstrap 4.\n\nYou can use it on [React](https://stackblitz.com/edit/bs-stepper-react) and [Angular](https://stackblitz.com/edit/bs-stepper-angular) too because this plugin is written with the most used JavaScript framework: [VanillaJS](http://vanilla-js.com/).\n\n[Demo](https://johann-s.github.io/bs-stepper/)\n\nIf you want to see our latest changes check out \u003chttps://bs-stepper.netlify.com/\u003e\n\nFeatures:\n\n- Linear stepper\n- Non linear stepper\n- Fade effect with `.fade`\n- Vertical stepper\n- Works with Bootstrap 4\n- Accessible\n- Works without *dependencies* (so no **jQuery** needed)\n- Built in UMD so it can be used everywhere\n- Small, only **2kb**\n\n## Table of contents\n\n- [Install](#install)\n- [How to use it](#how-to-use-it)\n- [Methods](#methods)\n- [Events](#events)\n- [Compatibility](#compatibility)\n- [Support me](#support-me)\n- [Thanks](#thanks)\n- [License](#license)\n\n## Install\n\n### With npm or yarn\n\n```sh\n# npm\nnpm install bs-stepper --save\n\n# yarn\nyarn add bs-stepper\n```\n\n### CDN\n\nCDN | Link\n------------ | -------------\njsDelivr, js minified | [`https://cdn.jsdelivr.net/npm/bs-stepper/dist/js/bs-stepper.min.js`](https://cdn.jsdelivr.net/npm/bs-stepper/dist/js/bs-stepper.min.js)\njsDelivr, css minified | [`https://cdn.jsdelivr.net/npm/bs-stepper/dist/css/bs-stepper.min.css`](https://cdn.jsdelivr.net/npm/bs-stepper/dist/css/bs-stepper.min.css)\n\n## How to use it\n\n### HTML markup\n\nInclude the CSS file:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"bs-stepper.min.css\"\u003e\n```\n\nAdd the following HTML:\n\n```html\n\u003cdiv class=\"bs-stepper\"\u003e\n  \u003cdiv class=\"bs-stepper-header\" role=\"tablist\"\u003e\n    \u003c!-- your steps here --\u003e\n    \u003cdiv class=\"step\" data-target=\"#logins-part\"\u003e\n      \u003cbutton type=\"button\" class=\"step-trigger\" role=\"tab\" aria-controls=\"logins-part\" id=\"logins-part-trigger\"\u003e\n        \u003cspan class=\"bs-stepper-circle\"\u003e1\u003c/span\u003e\n        \u003cspan class=\"bs-stepper-label\"\u003eLogins\u003c/span\u003e\n      \u003c/button\u003e\n    \u003c/div\u003e\n    \u003cdiv class=\"line\"\u003e\u003c/div\u003e\n    \u003cdiv class=\"step\" data-target=\"#information-part\"\u003e\n      \u003cbutton type=\"button\" class=\"step-trigger\" role=\"tab\" aria-controls=\"information-part\" id=\"information-part-trigger\"\u003e\n        \u003cspan class=\"bs-stepper-circle\"\u003e2\u003c/span\u003e\n        \u003cspan class=\"bs-stepper-label\"\u003eVarious information\u003c/span\u003e\n      \u003c/button\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"bs-stepper-content\"\u003e\n    \u003c!-- your steps content here --\u003e\n    \u003cdiv id=\"logins-part\" class=\"content\" role=\"tabpanel\" aria-labelledby=\"logins-part-trigger\"\u003e\u003c/div\u003e\n    \u003cdiv id=\"information-part\" class=\"content\" role=\"tabpanel\" aria-labelledby=\"information-part-trigger\"\u003e\u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\n- If you want to use the `fade` animation, add the `.fade` class on your `.content` and set `animation` to `true`.\n- To create a vertical stepper, just add the `.vertical` class on your stepper. All steppers will switch to vertical on small viewports.\n\n### JavaScript\n\nInclude the script before the end of the `\u003cbody\u003e` HTML tag:\n\n```html\n\u003cscript src=\"bs-stepper.min.js\"\u003e\u003c/script\u003e\n```\n\nOr with npm\n\n```js\nimport Stepper from 'bs-stepper'\n```\n\n### Create a stepper\n\nYou should wait for the document ready event and create a new instance of `Stepper`.\n\nVanilla JS\n\n```js\ndocument.addEventListener('DOMContentLoaded', function () {\n  var stepper = new Stepper(document.querySelector('.bs-stepper'))\n})\n```\n\nWith jQuery\n\n```js\n$(document).ready(function () {\n  var stepper = new Stepper($('.bs-stepper')[0])\n})\n```\n\nFor more examples check out [this file](https://github.com/Johann-S/bs-stepper/blob/master/tests/index.html).\n\nThis library is UMD-ready so you can use it everywhere.\n\n## Methods\n\n### constructor\n\nCreate an instance of `Stepper`, accepts two parameters.\n\n#### Parameters\n\n- `element`\n- type: `DOMElement`\n\nPass your `Stepper` DOMElement\n\n- `options` (optional)\n  - type: `Object`\n\n  default value:\n\n  ```js\n  {\n    linear: true,\n    animation: false,\n    selectors: {\n      steps: '.step',\n      trigger: '.step-trigger',\n      stepper: '.bs-stepper'\n    }\n  }\n  ```\n\n  Allows you to customize the stepper selectors and its behavior.\n\n### next\n\nWill navigate to the next step of your stepper. This method also emits the `show.bs-stepper`\nevent before showing the step and the `shown.bs-stepper` even when the step is displayed.\n\n```js\nvar stepper = new Stepper(document.querySelector('.bs-stepper'))\nstepper.next()\n```\n\n### previous\n\nWill navigate to the previous step of your stepper. This method also emits the `show.bs-stepper`\nevent before showing the step and the `shown.bs-stepper` event when the step is displayed.\n\n### to\n\nWill navigate to a step of your stepper. This method also emits the `show.bs-stepper` event\nbefore showing the step and the `shown.bs-stepper` event when the step is displayed.\n\n```js\nvar stepper = new Stepper(document.querySelector('.bs-stepper'))\n\n/// Will navigate to the second step\nstepper.to(2)\n```\n\n### reset\n\nWill reset your stepper to the first step (useful for linear stepper). This method also emits\nthe `show.bs-stepper` before showing the step and the `shown.bs-stepper` event when the step is displayed.\n\n### destroy\n\nRemove stored data related to your stepper and listeners.\n\n## Events\n\nThe methods which triggers a step change trigger two events:\n\n- `show.bs-stepper`\n- `shown.bs-stepper`\n\nYou can listen on those events like this:\n\n```js\nvar stepperEl = document.getElementById('stepper')\nvar stepper = new Stepper(stepperEl)\n\nstepperEl.addEventListener('show.bs-stepper', function (event) {\n  // You can call preventDefault to stop the rendering of your step\n  // event.preventDefault()\n\n  console.warn(event.detail.indexStep)\n})\n\nstepperEl.addEventListener('shown.bs-stepper', function (event) {\n  console.warn('step shown')\n})\n```\n\nThe event `detail` object contains the following properties:\n\n```\n{\n  indexStep: contains the id of the step which will be displayed,\n  to: alias of indexStep,\n  from: previous step id (or current step id)\n}\n```\n\nIf you need to prevent the display of a step, you have to call `preventDefault` on the `show.bs-stepper` listener.\n\n## Compatibility\n\nbsStepper is compatible with:\n\n- IE10+\n- Edge\n- Firefox\n- Chrome\n- Safari\n- Chrome Android\n- Safari iOS\n\nYou can find our BrowserStack list of browsers [here](https://github.com/Johann-S/bs-stepper/blob/master/tests/browsers.js).\n\n## Support me\n\nIf you want to thank me or support my work:\n\n- You can become my [Patron](https://www.patreon.com/jservoire)\n- Or buy me a coffee: [PayPal](https://www.paypal.me/jservoire)\n\n## Thanks\n\n[![BrowserStack Logo](https://www.browserstack.com/images/mail/browserstack-logo-footer.png)](https://www.browserstack.com/)\n\nThanks to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to test in real browsers!\n\n## License\n\n[MIT](https://github.com/Johann-S/bs-stepper/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohann-S%2Fbs-stepper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJohann-S%2Fbs-stepper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohann-S%2Fbs-stepper/lists"}