Bouncing Text
paceui-gsap/bouncing-textFreeComponent
A playful animation where characters bounce in sequence across the text.
Live preview
live · rendered by the registry
Rendered by PaceUI GSAP on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://gsap.paceui.com/r/bouncing-text.jsonSource
1"use client";23import { ComponentProps, useRef } from "react";45import { useGSAP } from "@gsap/react";6import gsap from "gsap";7import { SplitText } from "gsap/SplitText";89type BouncingTextProps = {10 repeat?: boolean | number;11} & ComponentProps<"p">;1213export const BouncingText = ({ repeat = true, ...props }: BouncingTextProps) => {14 const textRef = useRef<HTMLParagraphElement | null>(null);1516 useGSAP(17 () => {18 if (!textRef.current) return;19 let bounceCount = 0;20 const bounceChars = new SplitText(textRef.current, { type: "words,chars" }).chars;21 bounceChars.forEach((el) => {22 const tl = gsap.timeline({ repeat: repeat === true ? -1 : repeat === false ? 0 : repeat });23 tl.to(el, {24 duration: 0,25 y: -200,26 });27 tl.to(el, {28 duration: 2,29 y: 0,30 rotate: -10,31 ease: "bounce",32 });33 tl.to(el, {34 duration: 1,35 y: 0,36 rotate: 0,37 ease: "bounce",38 });39 tl.to(el, {40 duration: 2,41 y: -200,42 rotate: 0,43 delay: 1,44 ease: "elastic",45 });46 tl.delay(bounceCount / 8);47 bounceCount++;48 });49 },50 { scope: textRef },51 );5253 return <p {...props} ref={textRef} />;54};
What it pulls in
npm packages
Files it writes
More from PaceUI GSAP
All 29 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Modal Ability Selectorai-modal-ability-selector | PaceUI GSAP | Components | Free | 2 deps | |
| Modal Selectorai-modal-selector | PaceUI GSAP | Components | Free | 2 deps | |
| Response Writerai-response-writer | PaceUI GSAP | Components | Free | 2 deps · 2 files | |
| AI Suggestionsai-suggestions | PaceUI GSAP | Components | Free | 2 deps | |
| Modal Ability Selectorai-token-counter | PaceUI GSAP | Components | Free | 2 deps | |
| Animated Stackanimated-stack | PaceUI GSAP | Components | Free | 2 deps | |
| Dot Flowdot-flow | PaceUI GSAP | Components | Free | 2 deps | |
| Dot Loaderdot-loader | PaceUI GSAP | Components | Free | no deps |
