logo

Aki UI

アキ ウイ

Dynamic Text

ダイナミックテキスト

A burst of words that runs once and settles on the last one — a greeting flicking through its translations before landing on yours. Each step is its own setTimeout keyed off the current index rather than one repeating interval, because the run has to stop by itself and cancelling an interval from inside a state updater fires the stop twice. It overlaps Loop Cycle, which does the same swap with a longer hold and no end; reach for that one when the content should keep turning, and this one when the motion is an arrival. Adapted from Kokonut UI under the MIT licence.

Hello

Installation

Install the following dependencies:1

npm install framer-motion

Copy and paste the following code into a new component file:2

"use client"

/**
* Adapted for Aki UI from Kokonut UI's Dynamic Text.
* Original author: @dorianbaffier — https://kokonutui.com
* Copyright (c) 2025 kokonutUI, MIT License.
* https://github.com/kokonut-labs/kokonutui
*
* Reworked here onto the local palette, with shadcn primitives and
* class-variance-authority removed and motion/react swapped for framer-motion.

How to use it3

"use client"

import { DynamicText } from "@/components/ui/dynamic-text"

export default function Page() {
return (
<DynamicText
items={["Hello", "Bonjour", "Hola", "Ciao"]}
interval={300}
/>

Props

DynamicText

NameDefaultDescription
items

string[]

Words shown in order, the last one held

interval300

number

Milliseconds between steps

darkfalse

boolean

Render the dark palette