Skip to the content

Pixel ribbon

A ribbon of pixels trails the cursor, soft and liquid: it lies on the path the pointer has just taken, lags a little behind it and wobbles when the gesture turns.

Become a member to unlock the full effect today.

Join now

Already a member? Sign in

Documentation

  1. Copy to Webflow

    Add Geist and Geist Mono to your site's fonts (Site settings, Fonts, Google Fonts) before pasting: Webflow removes any font your site has not installed.

  2. Add custom CSS

  3. Add custom JS

  4. Tune it

    Custom attributes
    Select the section on the canvas and open the Settings panel. Under Custom attributes, add a pair: the name on the left, the value on the right.
    Custom attributeWhat it does
    data-pixel-ribbon Marks the section the ribbon runs over. It takes no value: leave the value field empty. That section is what the canvas is laid over, what catches the pointer and what carries the settings. Without it on any section of the page, the embed marks the section it was pasted into.
    data-pixel-ribbon-state Written by the engine on the section: live while the ribbon is drawn, idle at rest, still under reduced motion, held for a frozen ribbon. Never written by hand. [ Optional ]
    Settings
    Every setting is a custom attribute too, added the same way and on the same section. An attribute always wins over the defaults written in the code.
    AttributeDefaultWhat it is
    data-pixel-ribbon-color #ffab1a Colour of the pixels of the ribbon. Options: any CSS colour; taken out of this block, --pixel-ribbon-color on the section takes over, then the amber #ffab1a.
    data-pixel-ribbon-opacity 1 Opacity of the whole ribbon, 0 to 1.
    data-pixel-ribbon-cell 6 Side of one pixel of the grid the ribbon is drawn on, in px.
    data-pixel-ribbon-size clamp(9px, 0.82vw, 14px) Radius of the ribbon at its head, any CSS unit; the tail is thinner.
    data-pixel-ribbon-life 0.75 How long the ribbon takes to deflate once the pointer slows, in seconds.
    data-pixel-ribbon-burst 2.2 Reach of the drops a tap throws, in times size.

What it does

Pixel ribbon is a cursor animation for Webflow and vanilla JavaScript, with no library. Also called pixel cursor trail, liquid cursor trail or blob cursor effect.

A ribbon of pixels trails the cursor, soft and liquid: it lies on the path the pointer has just taken, lags a little behind it and wobbles when the gesture turns. Under it is a chain of blobs, each one tied by a spring to where the pointer was a moment earlier, summed into one field on a pixel grid, so they melt into a single shape; the pixels at its rim are drawn smaller, a fringe that keeps changing shape as the chain moves. The ribbon swells with the travel of the pointer, and when the pointer stops it folds back into its head and deflates, the tail last. Nothing but pixels, no picture to load: one canvas over the section, clicks pass through, and the loop only runs while something is on screen. A finger drag traces it too and a tap throws the chain out as drops that pull back in; under reduced motion there is no ribbon at all.

Updated

Questions

Paste the component: the trail runs over the section that carries the custom attribute data-pixel-ribbon, and nowhere else. Its settings are attributes on that same section, for instance data-pixel-ribbon-cell="8". An empty section is 0px tall and catches no pointer, so give it content or a height.

Neither. It runs on a 2D canvas with no library: a chain of blobs on springs, summed into one field on a pixel grid so they melt into a single shape. The loop only runs while pixels are on screen.

Change data-pixel-ribbon-size, the radius of the ribbon at its head, which accepts any CSS unit and defaults to clamp(9px, 0.82vw, 14px). A lower value gives a thin thread, and under about one cell nothing is drawn. A higher value gives a fat ribbon that swallows the words it crosses.

No. The system cursor stays where it is, and the canvas never takes a click, so links and buttons underneath keep working. If the ribbon should be the only mark, set cursor: none on the section yourself and keep the cursor on for links.

Yes. A finger drag traces the ribbon while the page still scrolls under it, and a short tap throws the chain out as drops that the springs pull back in. Under prefers-reduced-motion there is no ribbon at all, not even a still dot.