UNPKG

@start-base/start-ui

Version:

<p align="center"> <a href="https://startbase.dev" target="_blank"> <img src="https://startbase.dev/apple-touch-icon.png" width="60px" style="padding-top: 60px" /> </a> </p>

1 lines 569 B
import e,{useState as t,useEffect as a}from"react";import o from"clsx";var r="SUI-WordAnimation-module-root-vN7T4",n="SUI-WordAnimation-module-word-nAAg9",l="SUI-WordAnimation-module-visible-x30-Q",m="SUI-WordAnimation-module-hidden-49TaJ",s=({text:s="",className:i="",wordClassName:d=""})=>{const c=s.split(" "),[p,u]=t(0);return a(()=>{const e=setInterval(()=>{u(e=>e<c.length?e+1:e)},50);return()=>clearInterval(e)},[c.length]),e.createElement("span",{className:o(r,i)},c.map((t,a)=>e.createElement("span",{key:a,className:o(n,a<p?l:m,d)},t)))};export{s as default};