Skip to content

Add `badgeContent` prop

Compare
Choose a tag to compare
@elrumordelaluz elrumordelaluz released this 04 Sep 13:58
· 702 commits to main since this release

Allows to customize the content with two params current step and total step.

i.e

<Tour
   onRequestClose={closeTour}
   steps={[…]}
   isOpen={true}
   badgeContent={(cur, tot) => `${cur} of ${tot}`}
/>

or something more complex like

<Tour
   onRequestClose={closeTour}
   steps={[…]}
   isOpen={true}
   badgeContent={(cur, tot) => cur === 1 ? 'welcome!' : `${cur}/${tot}`}
/>

Thanks to @jovstern for the idea