Skip to the content

Button 04

A stroke draws itself around the button outward from the edge point nearest the pointer, a faint fill settles, and on the way out the stroke erases toward the exit point.

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

    The look of the preview is the button-set-* classes of the paste: the button at rest, its row and the words around it. The Embed only places the moving layers and holds the colour of the effect. On a button of your own, keep your class and add the attribute.
  3. Add custom JS

  4. Use it on your own elements

    Custom attribute
    Select the element 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-button-motion="outline" A stroke draws itself around the button from the nearest edge, a faint fill settles, and the stroke erases toward the exit.
    This file plays outline. Another animation of the set needs that button's own code on the page: without it, the button stays as the page styled it and the browser console says so. An empty or unknown value plays fill when fill's code is on the page, outline otherwise, and says so in the console.
    Settings
    Every setting is a custom attribute too, added the same way and on the same element. An attribute always wins over the defaults written in the code.
    AttributeDefaultWhat it is
    data-button-motion-color #ffab1a The colour of the stroke, and of the faint fill that settles inside it. Options: any CSS colour.
    data-button-motion-duration 0.6 Length of the stroke drawing itself, in seconds; it erases in eight tenths of it.
    data-button-motion-press 0.96 The scale of the button while it is pressed.

What it does

Button 04 (Outline) is a button hover animation for Webflow and vanilla JavaScript, built on GSAP 3. Also called button border draw animation, outline button animation or button border animation.

A stroke draws itself around the button outward from the edge point nearest the pointer, a faint fill settles, and on the way out the stroke erases toward the exit point. Played with GSAP on the button the page already has: the engine sets no font, size, border or background, only the colour of the effect, and puts the label back exactly on destroy. Keyboard focus, touch and reduced motion are handled. Button 04 of the Button set: another button of the set pasted on the same page shares its base. Pattern type outline draw, stroke draw, cta hover.

Updated