When initializing a new Boarding instance, you can provide a configuration object to define global behaviors such as animation, overlay appearance, button text, and lifecycle event handlers. These settings apply to all steps unless overridden in a specific step definition.
const boarding = new Boarding({
className: "scoped-class", // className to wrap boarding.js popover
animate: true, // Whether to animate or not
opacity: 0.75, // Overlay opacity (0 means only popovers and without overlay)
padding: 10, // Distance of element from around the edges
allowClose: true, // Whether the click on overlay should close or not
overlayClickNext: false, // Whether the click on overlay should move next
overlayColor: "rgb(0,0,0)", // Fill color for the overlay
doneBtnText: "Done", // Text on the final button
closeBtnText: "Close", // Text to the close button for this step
nextBtnText: "Next", // Next button text for this step
prevBtnText: "Previous", // Previous button text for this step
showButtons: false, // Do not show control buttons in footer
keyboardControl: true, // Allow controlling through keyboard (escape to close, arrow keys to move)
scrollIntoViewOptions: {
behaviour: "smooth",
}, // Options for scrollIntoView(). Set to "no-scroll" to disable.
onBeforeHighlighted: (HighlightElement) => {},
onHighlighted: (HighlightElement) => {},
onDeselected: (HighlightElement) => {},
onReset: (HighlightElement) => {},
onStart: (HighlightElement) => {},
onNext: (HighlightElement) => {},
onPrevious: (HighlightElement) => {},
strictClickHandling: true, // "block-all", true (isolate to highlighted element), or false
onPopoverRender: (el) => {
// Make changes to the actual popoverElements once they get rendered.
},
});