Animation with Motion's API, built on Effect
Wardic is an animation library with the API of Motion for React, built on Effect, for Solid and Foldkit. Both get elements that animate (initial, animate, exit, transition), variants that pass down the tree, hover, press, focus, drag and pan, layout and shared-element animations, presence, and values that follow the scroll or the pointer.
On a server-rendered page, mount animations play before the JavaScript has loaded, and the client takes them over mid-flight. And each page ships only the animation code it uses.
- Fast where motion happens: retargets, unmounts and each running frame in about half of Motion's time or less.
- Motion's API, the Solid way: a
w.divtakes what amotion.divtakes, with the Features its Wardic instance gives. - Built on Effect: replace parts of its engine, with Environments beyond the DOM planned, three.js scenes first.
Why Wardic has the numbers, and what it costs.
npm install @wardic/solid @wardic/dom effectpnpm add @wardic/solid @wardic/dom effectyarn add @wardic/solid @wardic/dom effectbun add @wardic/solid @wardic/dom effectimport { DomLive } from "@wardic/dom"
import { domAnimation, WardicProvider } from "@wardic/solid"
import { elements, makeWard } from "@wardic/solid/hooks"
// An app's Wardic instance, in a module of its own (src/lib/wardic.ts): hover, press, focus and in-view.
const { w } = makeWard({ features: domAnimation, elements })
export function App() {
return (
<WardicProvider env={DomLive}>
<w.div initial={{ opacity: 0, y: 12 }} animate={{ opacity: 1, y: 0 }} whileHover={{ scale: 1.05 }}>
Hello
</w.div>
</WardicProvider>
)
}Where next
- Start: install, the provider, your first element. On Solid 1, Start on Solid 1; on Foldkit, Start on Foldkit.
- Examples: Wardic Northlight, a shop whose every feature is an example, live and with its code, on Solid 2 and Foldkit.