Skip to content

Custom follower cursor

A round cursor follows the mouse inside a section and changes shape over links, buttons and project cards.

  • Tailwind
  • React
  • CSS
  • WordPress
Open in a new tab

Description

In a graphic design studio section, an orange dot and ring replace the mouse cursor: the dot sticks to the pointer while the ring trails slightly behind. Over a link, the ring grows and fills; over a button, it turns into a rotating square; over a project card, a “Voir” (view) disc appears. Any shape can be set with a simple data-efcp-shape attribute (link, button or view) on any element. About sixty lines of dependency-free JavaScript, limited to one update per frame, set two CSS variables; everything moves with transform and opacity. The effect stays inside its section and only turns on for a mouse: with touch, pen, prefers-reduced-motion or without JavaScript, the native cursor stays and the page looks the same. A keyboard-accessible switch (aria-pressed) also brings back the native cursor. Links and buttons keep their focus outline, text keeps AA contrast in light and dark themes, with no horizontal scrolling from 360 px. Colours, ring size and follow delay are set through CSS variables prefixed efcp.

Code

Loading the code…

The code of this component in

Archive contents

effet-curseur-personnalise-html-tailwind.zip3 files · 6 Ko

  • index.html13 Ko
  • README.md4 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 2, 2026.

Reviews

No reviews yet.

In the same spirit

  • Cards that fade in as they enter the screen, one after another in each row, without a line of JavaScript and with a static fallback.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A translucent card with a saturated blur whose sharper edge refracts the colourful shapes drifting behind it, with an opaque fallback when transparency is reduced.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A help block shaped like a conversation: bubbles, three animated typing dots and clickable quick replies that show your answers to frequent questions, frozen under prefers-reduced-motion.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component