Installation
Every component installs as source code you own. Pull it in with one CLI command, or copy the files by hand.
With the CLI
1Run the add command
Use whichever CLI you already have. Both install the same source.
- shadcn
npx shadcn@latest add @react-bits/SplitText-JS-CSS - jsrepo
npx jsrepo@latest add https://reactbits.dev/r/SplitText-JS-CSS
Swap
SplitTextfor any component. TheJS-CSSending picks the variant: JS or TS, then CSS or TW. On pnpm, yarn or bun, replacenpxwithpnpm dlx,yarnorbun x --bun.- shadcn
2Import and use it
Render it like any other component:
import SplitText from "./SplitText"; <SplitText text="Hello, you!" delay={100} duration={0.6} />
By hand
1Open a component's Code tab
It shows the full source. Pick JavaScript or TypeScript and CSS or Tailwind in the Preferences menu in the header, and every Code tab follows.
2Copy the files into your project
Paste the component into a new file, for example
SplitText.jsx.3Install its dependencies
The Code tab lists what each component needs. Split Text uses GSAP:
npm install gsap4Import and use it
Import and render it the same way as the CLI example above.
That's all
The code is yours now, so change the styles, props or behavior however you like.