Initilializing & Hooks

Using hooks with Onborda

Onborda comes pre-packed with helpful hooks to give you greater control over your users tour experience.

import { useOnborda } from "onborda"

startOnborda hook

The startOnborda and closeOnborda hooks are used to start and stop a tour.

const { startOnborda, closeOnborda } = useOnborda();

const onClickHandler = (tourName: string) => {
  startOnborda(tourName);
};

// or

return (
  <button onClick={() => closeOnborda()}>Close</button>
)