Precise DOM morphing
morphing typescript dom
TypeScript 84.1%
HTML 15.8%
Other 0.1%
238 1 0

Clone this repository

https://tangled.org/yippee.fun/morphlex https://tangled.org/did:plc:4crtcersdf55tzhbray4746o/morphlex
git@knot.tangled.wizardry.systems:yippee.fun/morphlex git@knot.tangled.wizardry.systems:did:plc:4crtcersdf55tzhbray4746o/morphlex

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

Morphlex

Morphlex is a ~2KB (gzipped) DOM morphing library that transforms one DOM tree to match another while preserving element state and making minimal changes.

Installation#

npm install morphlex

Or use it directly from a CDN:

<script type="module">
  import { morph } from "https://www.unpkg.com/morphlex@0.0.17/dist/morphlex.min.js"
</script>

Usage#

import { morph, morphInner } from "morphlex"

// Morph the entire element
morph(currentNode, referenceNode)

// Morph only the inner content
morphInner(currentNode, referenceNode)