Skip to content

yippee-fun/morphlex

Repository files navigation

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/[email protected]/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)

About

Optimal DOM morphing, written in TypeScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published