Skip to main content

User Focus Tracking

In its simplest use case, Focus Tracker can just track the current user's focus. A single configuration can be created on the document.body to provide a consistent experience.

import { registerFocusTrackerConfiguration } from '@michaeldrotar/focus-tracker-js/registerFocusTrackerConfiguration'
import { startUserFocusTracker } from '@michaeldrotar/focus-tracker-js/startUserFocusTracker'

registerFocusTrackerConfiguration(document.body, {
color: 'blue',
thickness: 2
})
startUserFocusTracker()
tip

Check out the Configuration page to see all options.