Skip to content

Options

INFO

This prop can be passed to both:

  • ROnboardingWrapper
  • Individual steps via step.options

You can override ROnboardingWrapper's options by passing options to individual steps.

Default Values

js
{
  popper: {},
  overlay: {
    enabled: true,
    padding: 0,
    borderRadius: 0
  },
  scrollToStep: {
    enabled: true,
    options: {
      behavior: 'smooth',
      block: 'center',
      inline: 'center'
    }
  },
  labels: {
    previousButton: 'Previous',
    nextButton: 'Next',
    finishButton: 'Finish'
  },
  hideButtons: {
    previous: false,
    next: false
  },
  disableInteraction: false
}

Properties

NameTypeDefaultDescription
popperPopperJS options{}PopperJS positioning options
overlayObjectOverlay configuration
overlay.enabledBooleantrueEnable/disable the overlay
overlay.paddingNumber | Object0Padding around the highlighted element
overlay.borderRadiusNumber | Object0Border radius for the highlighted area
scrollToStepObjectScroll behavior configuration
scrollToStep.enabledBooleantrueEnable/disable auto-scroll to step
scrollToStep.optionsScrollIntoViewOptions{ behavior: 'smooth', block: 'center', inline: 'center' }Scroll options
labelsObjectButton labels
labels.previousButtonString'Previous'Label for previous button
labels.nextButtonString'Next'Label for next button
labels.finishButtonString'Finish'Label for finish button
hideButtonsObjectHide navigation buttons
hideButtons.previousBooleanfalseHide the previous button
hideButtons.nextBooleanfalseHide the next button
disableInteractionBooleanfalseDisable page interaction during onboarding

Overlay Padding

The overlay.padding option can be a number (applied to all sides) or an object:

ts
{
  overlay: {
    padding: { top: 10, right: 10, bottom: 10, left: 10 }
  }
}

Overlay Border Radius

The overlay.borderRadius option can be a number (applied to all corners) or an object:

ts
{
  overlay: {
    borderRadius: { leftTop: 10, rightTop: 10, rightBottom: 10, leftBottom: 10 }
  }
}

Hide Buttons

You can hide the Previous and/or Next buttons:

tsx
// Hide previous button on all steps
<ROnboardingWrapper
  ref={wrapperRef}
  steps={steps}
  options={{ hideButtons: { previous: true } }}
/>

Or override per step:

ts
const steps = [
  {
    attachTo: { element: '#foo' },
    content: { title: 'Step 1' },
    options: { hideButtons: { previous: true } }
  },
  {
    attachTo: { element: '#bar' },
    content: { title: 'Step 2' }
    // Previous button will be shown (using wrapper defaults)
  }
];

Disable Interaction

When disableInteraction is true, the page will not be interactive during onboarding. Only the step element remains interactive:

tsx
<ROnboardingWrapper
  ref={wrapperRef}
  steps={steps}
  options={{ disableInteraction: true }}
/>

This is useful when you want to prevent users from clicking on elements outside the onboarding step.

Released under the MIT License.