Weave Text
loomui/weave-textFreeComponent
Text filled with a slow-drifting gradient, woven from a palette you control.
Live preview
live · rendered by the registry
Rendered by loomui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://loomui.design/r/weave-text.jsonSource
1"use client"23import * as React from "react"45import { cn } from "@/lib/utils"6import { useInViewport } from "@/registry/lib/use-in-viewport"78export interface WeaveTextProps extends React.ComponentProps<"span"> {9 /**10 * Colors woven through the gradient, left to right. The first color is11 * repeated at the end so the loop is seamless.12 */13 colors?: string[]14 /** Seconds for one full pass. Lower is faster. */15 duration?: number16 /** Render a static gradient with no animation. */17 paused?: boolean18}1920const DEFAULT_COLORS = ["#2dd4bf", "#38bdf8", "#3b82f6", "#67e8f9"]2122export function WeaveText({23 children,24 className,25 colors = DEFAULT_COLORS,26 duration = 8,27 paused = false,28 style,29 ...props30}: WeaveTextProps) {31 const root = React.useRef<HTMLSpanElement>(null)32 const onScreen = useInViewport(root)33 const backgroundImage = React.useMemo(() => {34 const stops = colors.length > 0 ? colors : DEFAULT_COLORS35 return `linear-gradient(90deg, ${[...stops, stops[0]].join(", ")})`36 }, [colors])3738 return (39 <span40 ref={root}41 data-slot="weave-text"42 className={cn(43 "inline-block bg-[length:200%_auto] bg-clip-text text-transparent",44 !paused && "animate-weave motion-reduce:animate-none",45 !onScreen && "[animation-play-state:paused]",46 className47 )}48 style={{49 backgroundImage,50 animationDuration: `${duration}s`,51 ...style,52 }}53 {...props}54 >55 {children}56 </span>57 )58}
What it pulls in
Other registry items
Files it writes
More from loomui
All 91 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Aurora Backdropaurora-backdrop | loomui | Components | Free | no deps | |
| Bento Gridbento-grid | loomui | Components | Free | no deps | |
| Card Stackcard-stack | loomui | Components | Free | no deps | |
| Compare Slidercompare-slider | loomui | Components | Free | no deps | |
| Confetti Buttonconfetti-button | loomui | Components | Free | no deps | |
| Count Upcount-up | loomui | Components | Free | no deps | |
| Credit Cardcredit-card | loomui | Components | Free | no deps | |
| Drawerdrawer | loomui | Components | Free | 1 dep |
