Motion Blocks

Text

Split Hover

Splits text into characters and animates stacked layers on hover for a seamless swap. Framework-agnostic Custom Element.

  • lit Preview of https://lit.devLitSimple. Fast. Web Components.
  • gsap Preview of https://gsap.comGSAPAnimate anything. Silky-smooth performance.

Preview

Characters split into two stacked layers that swap on hover.
Attributes

Installation

pnpm dlx motion-blocks add split-hover

Usage

---import "@/components/motion-blocks/split-hover-element.ts";--- <motion-split-hover text="Hover me"></motion-split-hover>

API Reference

Attribute Type Default
text The text content to display and animate. string ""