Quick start

One component from the Vault into a page. The Slide Fill Button is the example here; every other component goes in the same way.

Before you start

  • GSAP is loaded and on window. See Installation.
  • You have an account. The Slide Fill Button is one of the free components, so any account sees its code; the rest need Pro, Team or Lifetime. Open Slide Fill Button in the Vault.

Pick your stack

  1. Copy the CSS tab into a stylesheet you load once, globally.
  2. Copy the JS tab into a script you load once, after GSAP. It boots itself when the DOM is ready and finds every instance on the page.
  3. Paste the HTML where each button goes, then change the href and the label.
example.html
<a class="sfb_button" href="/contact" data-au-slide-fill-button
   data-au-variant="primary" data-au-shape="pill" data-au-exit="bottom">
  <span class="sfb_label">Get in touch</span>
  <span class="sfb_fill" data-sfb-fill aria-hidden="true"></span>
</a>

Keep the attributes and the inner spans: the script selects on data-au-slide-fill-button and data-sfb-fill. Classes are styling only and can be renamed, as long as the CSS is renamed to match.

Then tune it

Every option is an attribute. The controls beside the preview on the resource page let you try values live; write the ones you like into the attributes, or the props. The Customising guide covers options, CSS variables and what to do when instances are added after load.

If it does nothing

  • Check window.gsap exists in the console. If not, GSAP loaded after the component script, or wasn't exposed.
  • Check the root attribute is still there. The script only looks for data-au-slide-fill-button.
  • Look in the console: the script logs one line naming what it couldn't find.