Documentation

/

Demo 3 · scroll

Shaders by Paper · demo 3

scroll triggers

Mesh Gradient changes palette at three scroll steps, set up with Framer’s native scroll variants and no code. Scroll down to see it.

scroll variant 1 of 3

variant 1 · Ink

Each step on this page is a scroll section. Reaching one sets the shader’s variant.

variant 2 · Dusk

The component tweens every value between two variants: colors, distortion, swirl and rotation.

variant 3 · Paper

Scroll back up and the variants play in reverse.

Mesh Gradient in a native component with three variants, set by native scroll variants.

You can wrap a shader inside a native Framer component and create multiple variants. Then use Framer’s native scroll variants to trigger a change of variant. The change of values and settings will animate for almost all property controls offering a slider.

Steps

  1. Wrap your shader inside a Framer component (Cmd Option K)

  2. Create multiple variants with different settings

  3. Use native Framer scroll sections and scroll variants

  4. Adjust the easing curve of the primary variant to control how fast the animation happens

How this demo is set up

  • The component has three variants, Ink, Dusk and Paper. Each one gives the Mesh Gradient its own colors, distortion, swirl, rotation and scale.

  • The page has three step sections, each named as a scroll section: Step 1, Step 2 and Step 3.

  • The component on the page has one Scroll Variant effect with the Section in View trigger. Step 1 sets Ink, Step 2 sets Dusk and Step 3 sets Paper.

  • Each change fires when about half of its step is on screen, and plays again in reverse when you scroll back up.

  • The shader’s Transition control sets how long each change takes: here 1 second, on an ease-in-out curve.

Questions

Does it work on phones?

Yes. The steps are ordinary sections, so the same effect runs at every breakpoint. We checked it at desktop, tablet and phone widths.

Why does a setting jump instead of animating?

Only controls with a slider tween between variants. A setting you pick from a list changes at once when the variant switches.

Scroll variants work with any shader that has a Transition control, and Mesh Gradient is one of the three free ones. The setup steps are in the introduction.

Shaders by Paper is an independent product, not affiliated with paper.design. The shaders come from Paper Shaders, paper.design's open source library, released under the Apache 2.0 license.

f

+

framerlabs is constantly improving, make sure to come back regularly to check our updates.