A tiny JavaScript library to visually guide users with an animated pointer and onboarding flow.
- Animated pointer to highlight elements
- Onboarding flow with notes
- Customizable colors and styles
- Zero dependencies
npm install @apvarun/pointerjs
# or
bun add @apvarun/pointerjs
# or
pnpm add @apvarun/pointerjs
import { startOnboarding } from '@apvarun/pointerjs'
startOnboarding([
{ element: '#invite-btn', note: 'Click on the invite team button' },
{ element: '#profile', note: 'Check your profile here!' },
])
startOnboarding([{ element: '#invite-btn', note: 'Invite your team!' }], {
color: '#FF6F61',
fontFamily: 'monospace',
fontSize: '18px',
})
startOnboarding([
{ element: '#step1', note: 'Step 1', url: '/page1' },
{ element: '#step2', note: 'Step 2', url: '/page2' },
])
import { Pointer } from '@apvarun/pointerjs'
const pointer = new Pointer({ color: '#00C853' })
pointer.moveToElement(document.querySelector('#my-element'), 'Hello!')
Or use via CDN:
<script src="https://unpkg.com/@apvarun/pointerjs"></script>
<script>
PointerJS.startOnboarding([...])
</script>
-
steps
: Array of{ element, note, url? }
-
options
: Pointer customization (color, fontFamily, fontSize) -
event
: Optional MouseEvent to set initial pointer position
See the demo for a working example.
Pull requests and issues are welcome!
MIT © Varun A P