shapcnGitHub

Docs

shapcn morphs one icon into another. Change the name of a <morph-icon> element and the icon moves the way an animator would draw it. No animation is pre-built. The engine plans every frame when you ask.

Quick start

Add one script and one tag. The script defines the <morph-icon> element and loads the Lucide icons.

<script type="module" src="https://shapcn.com/morph-icon.js"></script>
<morph-icon name="menu" size="48"></morph-icon>

The demo above changes its name every two seconds. To do the same in your page, set the name attribute.

<script type="module" src="https://shapcn.com/morph-icon.js"></script>
<morph-icon name="menu" size="48"></morph-icon>
<script type="module">
  const icon = document.querySelector('morph-icon');
  setTimeout(() => icon.setAttribute('name', 'x'), 1000);
</script>

The icon morphs from menu to x. Set name to an empty string and the icon hides with an effect. Set a name again and it shows.

What is in the docs

Back to the site

Markdown and LLM files

Every page has a Markdown twin. Add .md to the path, for example /docs/element.md. The file /llms.txt lists the pages. The file /llms-full.txt holds all pages in one file.

Markdown version