Chaperone (not publish yet)

is a react library which helps and guide the user interacts with UI step by step to have a better user experience in your react components. Chaperone gives you alot of option with such ability to make your user experience alot better. it allow such gesture to tell the user what to do next even without reading the dialog. it is even flexible in any component whether it is forwardRef or not.

Installation #

npm i chaperone
Imports #

import { Chaperone, ChaperoneStep, Trigger } from "chaperone";
Getting Started #

it is the basic usage of chaperone.

Need Help?

Don't forget to assign isDone at the last step or else it will throw exception.

ChaperoneStep Singleton #

it is use to make multiple and different id steps in single ChaperoneStep.

click here to know me.
beard-manFernando(Mytabworks)
Multiple ID and Chaining #

you can create multiple guide in single Chaperone and you can chain another ID after done or skip.

Email Help?
Password Help?

you must be extra careful when using onDone and onSkip in Chaperone component. especially if the component is having some sort of state. or else it will be called infinitely and will cause error in your app. as much as posible use hook useCallback without array dependency to prevent some sort of error any further.

Chaperone With Gestures #

you can create and append gestures.

Need Help?

API

Chaperone #

It is the chaperone.

Property
Property
Type
Type
Default
Default
Description
Description
autoTriggerbooleanfalseWhen true, it will be triggered immidiately without clicking the trigger
idstring-It is the ID of the autoTrigger
waitSearchIndexnumber50It is the waiting time when searching indexes
childrenelement-A children element to render.
ChaperoneStep #

It is the chaperone step.

Property
Property
Type
Type
Default
Default
Description
Description
idstring-It is use to identify which set of step will be trigger since you can use multiple set of steps to trigger inside Chaperone.
indexnumber-It is use to determine on what index should this component will be pop.
messagestring | element-It is the message of the popover.
placement'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom'bottom-rightIt is the placement of the popover.
durationmiliseconds|number200It the duration of the transitions.
navigationnumber0It is use to show the navigation and how many bullets will be render. most commonly the number of your set steps. when 0, it will be hidden
childrenelement-It will be highligthened target of the step.
autoScrollDelaymiliseconds | number150It is the delay when chasing the next or previous step viewport after triggered.
allowSkipbooleantrueWhen false, the skip button will be hidden.
allowBackbooleantrueWhen false, the back step button will be hidden.
allowNextbooleantrueWhen false, the next step button will be hidden.
allowNextOnClickbooleanfalseWhen true, the next step is allowed to be triggered by hitting the highlightened element.
allowNextOnTypebooleanfalseWhen true, the next step is allowed to be triggered by typing the highlightened form input element.
isDonebooleanfalseWhen true, the done button will be shown, and it is use to tell chaperone that it is the last step. it is required to put it one your last steps on every set or it will bring some error.
isDoneOnClickbooleanfalseWhen true, done is allowed to be triggered by clicking the highlightened element.
backToIndexnumber-It is use to jump back a certain index when clicking the back button.
nextToIndexnumber-It is use to jump on a certain index when triggering all the next event.
neumorphismbooleanfalseWhen true, it change the style of the popover.
hideEvidencebooleantrueWhen false, it will not re-render when find matches on every events and will not hide the wrapper <div/> to the children.
Trigger #

It is the trigger to the chaperone.

Property
Property
Type
Type
Default
Default
Description
Description
aselementType<a>You can use a custom element type for this component.
labelstring|element-It is the label of the trigger.
idstring-It is use to determine which set will be open.
indexnumber0It is use to determine which index of the set will be open.
allowTransitionbooleanfalseWhen true, it allows you to transition effect the highlight.
Warning!

In this pre-deployed stage, most of the library you will witness has yet been publish or update in npm.