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

  1. 1Run the add command

    Use whichever CLI you already have. Both install the same source.

    • shadcnnpx shadcn@latest add @react-bits/SplitText-JS-CSS
    • jsreponpx jsrepo@latest add https://reactbits.dev/r/SplitText-JS-CSS

    Swap SplitText for any component. The JS-CSS ending picks the variant: JS or TS, then CSS or TW. On pnpm, yarn or bun, replace npx with pnpm dlx, yarn or bun x --bun.

  2. 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

  1. 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.

  2. 2Copy the files into your project

    Paste the component into a new file, for example SplitText.jsx.

  3. 3Install its dependencies

    The Code tab lists what each component needs. Split Text uses GSAP:

    npm install gsap
  4. 4Import 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.