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.div takes what a motion.div takes, 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 effect
pnpm add @wardic/solid @wardic/dom effect
yarn add @wardic/solid @wardic/dom effect
bun add @wardic/solid @wardic/dom effect
import { 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