gilbarbara / react-joyride

Create guided tours in your apps
https://react-joyride.com/
MIT License
6.88k stars 529 forks source link

Provide alternative way to render Joyride via render props #304

Closed tobilen closed 5 years ago

tobilen commented 6 years ago

As discussed here, a render prop would provide a great way to modify presentation of joyrides tour steps, for example use your own buttons or tooltip component.

This is how you could potentially use it:

import Joyride from 'react-joyride';
import Tooltip from 'react-joyride/lib/Tooltip';

const CustomTooltip = (
  <Tooltip
    render={(tooltipProps, tooltipState) => (<div>
        <span className="custom-header" style={tooltipState.styles.header}>
          {tooltipProps.step.title}
        </span>
      </div>)
    }
  />
);

return <Joyride /* ... other Joyride props */ tooltipComponent={CustomTooltip} />;
gilbarbara commented 6 years ago

This will come soon. You can try it with: npm i react-joyride@next