Skip to Content
Kokonut UI

TX-02Texts

Dynamic Text

Morphing text where shared letters travel, old ones fall and new ones land, with decode and cycle modes.

Install with
no extra packages

PROKinetic Type Hero and more like it are in Kokonut UI Pro

Installation

Dynamic Text is a free, open-source React component in the Kokonut UI Texts collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/dynamic-text.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/dynamic-text

Usage

import DynamicText from "@/components/kokonutui/dynamic-text";

export default function Example() {
  return <DynamicText />;
}

Props

mode
DynamicTextModeDefault "morph"

morph: letters travel, fall and land. decode: monospace cells scramble and lock left to right. cycle: morphs through words with a greeting rhythm (a long first word, faster middle words, a hold on the last).

text
string

The string to show. Change it to animate. When set, words is ignored.

words
(string | Greeting)[]

Words to rotate through when text is not set.

interval
number

Milliseconds each word holds. In cycle mode this is the first word's hold; the middle words speed up from there.

loop
boolean

Start over after the last word. Defaults to true, except in cycle.

onComplete
() => void

Called once the last word is shown. Never called when looping.

className
string

Extra classes for the root element.

DynamicTextMode

type DynamicTextMode = "morph" | "decode" | "cycle";

Greeting

textrequired
string
lang
string

BCP 47 language tag, so screen readers pronounce each word correctly.

Dependencies

NeedsVersionComes from
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.