Onboarding
Bootstrap 5 Onboarding plugin
Onboarding is a guide plugin to show users how to use your website
Responsive Onboarding plugin built with the latest Bootstrap 5. It is is a guide plugin to show users how to use your website.Note: Read the API tab to find all available options and advanced customization
Note: Currently, the plugin is only compatible with the basic MDB package imported in UMD format. More about import MDB formats.
Basic example
To initialize Onboarding on your page simply add data-mdb-onboarding-init
attribute to the
container of your steps and pass options via
data-mdb-attributes
listed in the API tab. Options data-mdb-step
,
data-mdb-index
and data-mdb-onboarding-content
are required for every step.
Start options
Autostart
Onboarding can be auto initialized by passing
data-mdb-auto-start
attribute to the steps container element. You can set the amount of time after
which Onboarding will be triggered using the
data-mdb-start-delay
attribute.
Event triggered start
Specify the element with which the user needs to interact to initiate the Onboarding by passing its selector to
data-mdb-start-trigger
. Action that will start Onboarding can be set via
data-mdb-start-event
attribute.
Backdrop options
Global backdrop
Backdrop for every step inside Onboarding can be set with
data-mdb-backdrop
and data-mdb-backdrop-opacity
attributes.
Individual step backdrop
Individual backdrop options can be set with the same data-mdb-backdrop
and
data-mdb-backdrop-opacity
attributes as the global backdrop settings.
Autoplay
Set data-mdb-autoplay
and data-mdb-steps-duration
to enable autoplay
for every step inside the container.
Autoscroll
Toggle auto scrolling into element that is outside the view with
data-mdb-autoscroll
attribute.
Popover customization
Popover class
Add custom class for popovers by setting custom-class
attribute and style it in
your css sheet.
Container example
Gallery






Onboarding - API
Import
Usage
Via data attributes
Using the Onboarding plugin doesn't require any additional JavaScript code - simply add
data-mdb-onboarding-init
attribute to
the container of your steps
and use other data attributes to set all options.
Via JavaScript
Via jQuery
Note: By default, MDB does not include jQuery and you have to add it to the project on your own.
Options
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to
data-mdb-
, as in data-mdb-next-label=""
.
Global
Name | Type | Default | Description |
---|---|---|---|
nextLabel
|
String | 'Next' |
Defines label for next step button inside popover element |
prevLabel
|
String | 'Back' |
Defines label for previous step button inside popover element |
skipLabel
|
String | 'Skip' |
Defines label for skip button inside popover element |
finishLabel
|
String | 'Finish' |
Defines label for finish button inside popover element |
pauseLabel
|
String | 'Pause' |
Defines label for pause button inside popover element when
autoPlay ,stepsDuration or step duration is
set
|
resumeLabel
|
String | 'Resume' |
Defines label for resume button inside popover element when
autoPlay ,stepsDuration or step duration is
set
|
btnMain
|
String | 'btn-primary' |
Set class for main button style |
btnClose
|
String | 'btn-danger' |
Set class for skip and finish buttons |
btnPause
|
String | 'btn-primary' |
Set class for pause control button |
btnResume
|
String | 'btn-success' |
Set class for resume control button |
steps
|
Array | [] |
An array of items to create step elements. Each element should contain the required
index and onboardingContent
|
startTrigger
|
String | '' |
Set selector for HTML element that will start Onboarding when
startEvent occurs.
|
startEvent
|
String | 'click' |
Set event on startTrigger element which will start Onboarding, e.g.
mouseover or click
|
autostart
|
Boolean | false |
Set Onboarding to start automatically after
startDelay seconds
|
startDelay
|
Number | 0 |
Set time in seconds after which Onboarding will start. Use it with
autoStart or startTrigger / startEvent combination
|
autoplay
|
Boolean | false |
Set automatic step change on or off. Use it in combination with
stepsDuration
|
stepsDuration
|
Number | 0 |
Set time in seconds after which each step will automatically change to next |
autoscroll
|
Boolean | true |
Defines whether window should automatically scroll into opened step position |
startIndex
|
Number | 1 |
Set index from which Onboarding will start |
debounce
|
Number | 300 |
Set time in milliseconds after which changing of steps via keyboard navigation will be possible |
backdrop
|
Boolean or the string 'static' |
false |
Set a backdrop element. Alternatively, specify
static for a backdrop which doesn't close the popover on click.
|
backdropOpacity
|
Number | 0.5 |
Set opacity for step popover backdrop element |
autoFocus
|
Boolean | false |
Set auto focusing step popover element on or off |
customClass
|
String | '' |
Adds user's custom class to popover element |
Each individual step attribute will overwrite its global counterpart behavior.
Step
Name | Type | Default | Description |
---|---|---|---|
nextLabel
|
String | '' |
Overwrites global nextLabel attribute for single step |
prevLabel
|
String | '' |
Overwrites global prevLabel attribute for single step |
skipLabel
|
String | '' |
Overwrites global skipLabel attribute for single step |
finishLabel
|
String | '' |
Overwrites global finishLabel attribute for single step |
pauseLabel
|
String | '' |
Overwrites global pauseLabel attribute for single step |
resumeLabel
|
String | '' |
Overwrites global resumeLabel attribute for single step |
btnMain
|
String | '' |
Overwrites global btnMain attribute for single step |
btnClose
|
String | '' |
Overwrites global btnClose attribute for single step |
btnPause
|
String | '' |
Overwrites global btnPause attribute for single step |
btnResume
|
String | '' |
Overwrites global btnResume attribute for single step |
onboardingContent
|
String | '' |
Set content for step element. Can receive HTML templates |
index
|
Number | null |
Set index number for step element |
target
|
String | null | null |
Define selector for step element when creating Onboarding via JS |
placement
|
String | 'bottom' |
Define placement of step popover. auto | top | bottom | left | right |
title
|
String | '' |
Set title for step popover element. When no title given, popover shows progress indicator |
backdrop
|
Boolean | null | null |
Overwrites global backdrop attribute for single step |
duration
|
Number | 0 |
Overwrites global stepsDuration attribute for single step |
autoplay
|
Boolean | true |
Set step autoplay attribute to false to turn off global
autoplay for this particular step
|
Methods
Name | Parameters | Description | Example |
---|---|---|---|
open |
index | Starts Onboarding on step set by the index key. Default is the first step. | instance.open(1) |
close |
Closes opened step popover. |
instance.close()
|
|
nextStep
|
Opens next step popover. |
instance.nextStep()
|
|
prevStep
|
Opens previous step popover. |
instance.prevStep()
|
|
pause
|
Pauses Onboarding on current step when autoplay is on. |
instance.pause()
|
|
resume |
Resumes Onboarding on current step when autoplay is on. |
instance.resume()
|
|
dispose
|
Removes the Onboarding instance. |
instance.dispose()
|
|
getInstance
|
element | Static method which allows to get the Onboarding instance associated with a DOM element. |
Onboarding.getInstance(element)
|
Events
Name | Description |
---|---|
start.mdb.onboarding
|
Emitted when an Onboarding has started. |
end.mdb.onboarding
|
Emitted when the last step of the Onboarding has ended. |
open.mdb.onboarding
|
Emitted when a step element has opened. |
close.mdb.onboarding
|
Emitted when a step element has closed. |
next.mdb.onboarding
|
Emitted when next step is about to be opened. |
prev.mdb.onboarding
|
Emitted when previous step is about to be opened. |