Animated Gradient Text
svelte-animations/animated-gradient-textFreeBlock
An animated gradient background which transitions between colors for text.
Install it
npx shadcn@latest add https://sv-animations.vercel.app/r/animated-gradient-text.jsonSource
1<script lang="ts">2 import { cn } from "$UTILS$";3 import type { Snippet } from "svelte";45 type AnimatedGradientTextProps = {6 speed?: number;7 colorFrom?: string;8 colorTo?: string;9 children: Snippet;10 class?: string;11 rest?: Record<string, any>;12 };1314 let {15 speed = 1,16 colorFrom = "#ffaa40",17 colorTo = "#9c40ff",18 children,19 class: className = "",20 ...rest21 }: AnimatedGradientTextProps = $props();22</script>2324<span25 style="--color-from:{colorFrom}; --color-to:{colorTo}; --bg-size:{300 * speed}%"26 {...rest}27 class={cn(28 `animate-gradient inline bg-linear-to-r from-(--color-from) via-(--color-to) to-(--color-from) bg-size-[var(--bg-size)_100%] bg-clip-text text-transparent`,29 className30 )}31>32 {@render children?.()}33</span>
Files it writes
More from Svelte Animations
All 66 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Beamanimated-beam | Svelte Animations | Blocks | Free | 1 dep · 6 files | |
| Animated Circular Progress Baranimated-circular-progress-bar | Svelte Animations | Blocks | Free | no deps · 2 files | |
| Animated Grid Patternanimated-grid-pattern | Svelte Animations | Blocks | Free | 1 dep · 2 files | |
| Animated Listanimated-list | Svelte Animations | Blocks | Free | 1 dep · 2 files | |
| Animated Shiny Textanimated-shiny-text | Svelte Animations | Blocks | Free | no deps | |
| Animated Theme Toggleranimated-theme-toggler | Svelte Animations | Blocks | Free | no deps · 2 files | |
| Arc Timelinearc-timeline | Svelte Animations | Blocks | Free | no deps · 3 files | |
| Aurora Textaurora-text | Svelte Animations | Blocks | Free | no deps · 2 files |
