Skip to content

Text morph

Morph a label into its next state, letter by letter.

TextMotionStatus
npx shadcn@latest add @silicon-ui/text-morph

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/text-morph

Manually

  1. Install the dependencies

    npm install motion
  2. Copy these files into your project

    • components/silicon-ui/text-morph/text-morph.tsx
    • components/silicon-ui/text-morph/text-morph.module.css
  3. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
import { TextMorph } from "@/components/silicon-ui/text-morph/text-morph";

API reference

PropTypeDefault
children*string—
as"span" | "div" | "p" | "strong" | "h1" | "h2" | "h3""span"
classNamestring—
idstring—

Dependencies

npm
motion
Registry
silicon-motion-tokens