scroll-text
jolyui-ui/scroll-textFreeComponent
jolyui/ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by jolyui/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://jolyui.dev/r/scroll-text.jsonSource
1import {2 type MotionValue,3 motion,4 useScroll,5 useSpring,6 useTransform,7} from "motion/react";8import * as React from "react";9import { cn } from "@/lib/utils";1011// ============================================================================12// TYPES13// ============================================================================1415type ScrollEffect =16 | "fadeIn"17 | "fadeUp"18 | "fadeDown"19 | "parallax"20 | "scale"21 | "scaleUp"22 | "scaleDown"23 | "rotate"24 | "blur"25 | "slideLeft"26 | "slideRight"27 | "skew"28 | "flip"29 | "reveal";3031interface ScrollTextProps {32 children: React.ReactNode;33 effect?: ScrollEffect;34 className?: string;35 offset?: [string, string];36 speed?: number;37 spring?: boolean;38 springConfig?: { stiffness?: number; damping?: number; mass?: number };39 threshold?: [number, number];40}4142interface ParallaxTextProps {43 children: React.ReactNode;44 className?: string;45 speed?: number;46 direction?: "up" | "down" | "left" | "right";47 spring?: boolean;48}4950interface ScrollRevealProps {51 children: React.ReactNode;52 className?: string;53 direction?: "up" | "down" | "left" | "right";54 delay?: number;55 duration?: number;56 distance?: number;57 once?: boolean;58}5960interface ScrollFadeProps {61 children: React.ReactNode;62 className?: string;63 fadeIn?: boolean;64 fadeOut?: boolean;65 threshold?: [number, number];66}6768interface ScrollScaleProps {69 children: React.ReactNode;70 className?: string;71 from?: number;72 to?: number;73 threshold?: [number, number];74}7576interface HorizontalScrollTextProps {77 children: React.ReactNode;78 className?: string;79 speed?: number;80 direction?: "left" | "right";81 repeat?: number;82}8384interface ScrollProgressTextProps {85 text: string;86 className?: string;87 charClassName?: string;88 stagger?: number;89}9091interface StickyScrollTextProps {92 children: React.ReactNode;93 className?: string;94 height?: string;95 effect?: "fade" | "scale" | "blur" | "color";96}9798// ============================================================================99// SCROLL TEXT COMPONENT100// ============================================================================101102const ScrollText = React.forwardRef<HTMLDivElement, ScrollTextProps>(103 (104 {105 children,106 effect = "fadeIn",107 className,108 offset = ["start end", "end start"],109 speed = 1,110 spring = false,111 springConfig,112 threshold = [0, 1],113 },114 forwardedRef,115 ) => {116 const internalRef = React.useRef<HTMLDivElement>(null);117// … truncated
What it pulls in
npm packages
Files it writes
More from jolyui/ui
All 199 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-prompt-boxai-prompt-box | jolyui/ui | Components | Free | 4 deps | |
| animated-beamanimated-beam | jolyui/ui | Components | Free | 1 dep | |
| animated-tableanimated-table | jolyui/ui | Components | Free | 2 deps | |
| animated-theme-toggleanimated-theme-toggle | jolyui/ui | Components | Free | 2 deps | |
| animated-toastanimated-toast | jolyui/ui | Components | Free | 2 deps | |
| animated-tooltipanimated-tooltip | jolyui/ui | Components | Free | 1 dep | |
| bento-gridbento-grid | jolyui/ui | Components | Free | no deps | |
| buttonbutton | jolyui/ui | Components | Free | 3 deps |
