
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
Spring animations in React & Typescript. Zero dependencies and lightweight (2kb). A simple alternative to libraries like framer-motion (~50kB) and react-spring (~20kB).
Import the useSpring hook, and tag the element you want to animate with the ref property.
import { useSpring } from "wiggly"
function Panel() {
const [open, setOpen] = useState(false)
const y = useSpring(0)
useEffect(() => {
y.set(120)
}, [open])
return <div ref={y.ref} style={{ transform: `translateY(${y})` }} />
}
To animate multiple properties, create multiple springs and combine the refs with the combineRefs helper:
import { useSpring, combineRefs } from "wiggly"
function Ball(props) {
const x = useSpring(0)
const y = useSpring(0)
useEffect(() => {
x.set(props.x)
y.set(props.y)
}, [props])
return (
<div
ref={combineRefs(x.ref, y.ref)}
style={{ transform: `transform(${x}, ${y})` }}
/>
)
}
A few examples of how to use wiggly are in the examples directory.
I frequently want to add spring-based animations to React apps, but feel guilty when I see the bundle sizes of existing solutions
react-spring is 19.4kB large.framer-motion is 50.9kB. They offer a tree-shaking guide, but it doesn't make a huge difference in my testing. It's also a general purpose animation toolkit, which you don't often needmotion is only 9.4kB, but doesn't offer React bindings (yet)Wiggly is only 2kb. Most of that is wobble, which provides the spring logic. Of course, this low weight comes with a few limitations:
red to blue or #000 to #fff). If you want this, you can animate a value between 0 to 1 and map the change yourself using a library like chroma.js to do the math.transform or whatnot. This gives you more control, but it takes a little more work.Wiggly illustration was made by Hannah Lee.
FAQs
Unknown package
The npm package wiggly receives a total of 22 weekly downloads. As such, wiggly popularity was classified as not popular.
We found that wiggly demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.