Pointer Highlight
Draws an outline around a phrase on scroll, then glides a pointer icon to its corner.
- 1.2 KB gzipped
- Deps: motion/react
- Reduced-motion safe
- Base UI & Radix compatible
Every component ships with reduced motion built in.
Installation
pnpm dlx shadcn@latest add https://velora.colorlib.com/r/pointer-highlight.jsonAdds components/velora/pointer-highlight.tsx, installs motion.
Examples
Hero headline
A hero headline with one highlighted phrase, a subtitle and two buttons.
Feedback that lands on the exact pixel
Pin comments to any element, resolve them in context, and ship without the screenshot ping-pong.
Props
| Prop | Type | Default |
|---|---|---|
children*The phrase to frame | React.ReactNode | — |
rectangleClassNameClasses for the drawn outline (border colour, width, radius, fill) | string | — |
pointerClassNameClasses for the pointer icon (colour, size) | string | — |
oncePlay only the first time the phrase enters the viewport | boolean | true |
Also accepts every <span> attribute, forwarded to the root element.
Accessibility
- Reduced motion
- The outline and pointer are shown in their final place as soon as the phrase is on screen, with no drawing or glide.
- Keyboard
- Decorative — nothing to operate.
- Screen readers
- The text is read normally; the outline and pointer icon are aria-hidden.