NK

Search

Search pages, projects, posts, components, and icons

All components

Scroll Cue

Navigation

A mouse-shaped scroll hint that fades out once the reader scrolls.

Hero content

Installation

Add it with the shadcn CLI:

$pnpm dlx shadcn@latest add https://nawalkattel.com.np/r/scroll-cue.json
Or install manually
  1. 1. Install dependencies

    pnpm add motion clsx tailwind-merge
  2. 2. Copy the component source into components/library/scroll-cue.tsx

Props

PropTypeDefaultDescription
labelstring"Scroll"Text under the mouse. Empty string shows only the icon.
thresholdnumber80How far the reader must scroll, in px, before it fades.
containerSelectorstring - Selector for the scrolling element, when the window is not what scrolls.

Accessibility

  • aria-hidden: it is a hint, and the page is scrollable without it.
  • pointer-events-none, so it never intercepts a click.
  • Holds still under prefers-reduced-motion rather than looping.
  • Hidden below the sm breakpoint, where a scroll hint earns nothing.

Dependencies

motionclsxtailwind-merge