
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
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
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
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.