Components

Star Cursor

A star-shaped cursor with an offset outline, a glowing comet tail, and sparkle dust. Turns on only for a mouse and stays off when the visitor prefers reduced motion.

Move your mouse hereDrag your finger here

Customize

size25
strokeWidth2
offset2.5
starColor
outlineColor
tailColor
tailLength30
tailWidth12
dust

Usage

Add StarCursor.tsx and color.ts to your project, then render it. The snippet updates with your Customize settings.

Example.tsx
import { StarCursor } from './StarCursor'

export default function Example() {
  return (
    <>
      <StarCursor />
      {/* your app */}
    </>
  )
}
NameTypeDefaultDescription
sizenumber25Star width and height in px.
strokeWidthnumber2Star outline width.
offsetnumber2.5Extra outline thickness on the bottom and right edges, like an offset shadow. 0 gives an even outline.
starColorstring'#ffffff'Star fill colour.
outlineColorstring'#0b0e1a'Star outline and offset colour.
tailColorstring'#ffffff'Colour of the comet tail and sparkle dust.
tailLengthnumber30Points in the tail. Longer tails trail further behind the pointer.
tailWidthnumber12Tail width in px at the star, tapering to a point.
dustbooleantrueSparkle dust that falls from the tail when the pointer moves quickly.
boundary'window' | 'parent''window'Follow the pointer across the whole window, or only inside the parent element. 'parent' needs a parent with position: relative.
touchbooleanfalseAlso follow a finger or pen on touch screens. The star hides when the finger lifts.

Get Star Cursor

Buy this component on its own, or get all three in the Night Sky UI Kit.