Updated
Falling Letters
Customize
Duration0.60s
Spread0.35s
Drop36px
Text size48px
Installation
npx shadcn@latest add https://uibrik.com/r/falling-letters.jsonInstall the packages
npm install motionAdd the cn helper
Imports
cnfrom@/lib/utils, whichshadcn initcreates. Add it by hand without shadcn.Copy the source into your project
components/uibrik/falling-letters/falling-letters.tsx"use client"; import { cn } from "@/lib/utils"; import { motion, type Easing } from "motion/react"; import { useLayoutEffect, useRef, useState } from "react"; // `play` counts presses of a card's Change button. 0 means the card has not // been pressed yet, so every effect renders its resting state without // animating on page load. export type EffectProps = { play: number }; // Size comes from --text-effect-size (default 1.25rem, i.e. text-xl), so a // preview can enlarge every effect without changing the installed default. const SIZE = "text-[length:var(--text-effect-size,1.25rem)] leading-[1.4]"; const TEXT = `${SIZE} text-zinc-700 font-medium dark:text-zinc-200`; const glyph = (ch: string) => (ch === " " ? " " : ch); // 15 — Letters fall and land with weight. Each one accelerates down while // stretched and slightly tilted, squashes against the baseline on impact // (scaled from its foot), gives a small rebound and straightens. Start times // follow each letter's position on the line, so wide glyphs hold the wave // back, plus a small fixed jitter so the wave never feels mechanical.
Adds the files to
components/uibrik/falling-letters and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/falling-letters.Usage
import { FallingLetters } from "@/components/uibrik/falling-letters/falling-letters";<FallingLetters play={0} text="Falling into place" duration={0.6} spread={0.35} drop={36}/>Where to use Falling Letters
Welcome screens
Letters dropping in with a small bounce make a greeting feel friendly.
Success messages
A playful landing works for onboarding steps and completion states.
Kids and game brands
Bouncy type suits brands aimed at children or casual players.
Pairs with Domino Letters
Props
FallingLetters- text
- Type string
- "Falling into place"
- The copy to animate.
- duration
- Type number
- 0.6
- Time for one letter to fall and settle.
- spread
- Type number
- 0.35
- Time for the wave to cross the line.
- drop
- Type number
- 36
- Height each letter falls from.
- playrequired
- Type number
- –
- Each change plays the effect again; 0 shows its resting state.