AnimationsNew

Float

Gently sways any block in three dimensions as if it hangs in the air. Brings covers, cards and icons to life.

Customize

color
accentColor
highlightColor

Based on Float (MIT license) ยท Terms of use

More in Pro

View all

Props

9 properties
PropertyTypeDefaultDescription
childrenReactNodeโ€”What floats.
speednumber0.5Swaying speed.
amplitude[number, number, number]"[10, 30, 30]"Movement range on X, Y and Z, in pixels.
rotationRange[number, number, number]"[15, 15, 7.5]"Tilt range on X, Y and Z, in degrees.
timeOffsetnumber0Phase shift. Different values keep several blocks out of sync.
colorstring"#ffffff"Main colour. Children read it as var(--float-c1).
accentColorstring"#a3a3a3"Second colour. Children read it as var(--float-c2).
highlightColorstring"#e5e5e5"Light highlight colour. Children read it as var(--float-c3).
classNamestringโ€”Extra classes.

Dependencies

3 required packages

npm install motion clsx tailwind-merge

Related components

View all