Getting Started
Components
Special Effects
Animations
Text Animations
Backgrounds
An animated gradient text component with aurora-like flowing colors.
Ship beautiful beautiful
aurora-text.svelte
<script lang="ts"> import AuroraText from "$lib/components/magic/aurora-text/aurora-text.svelte";</script>
<h2 class="text-4xl font-bold tracking-tighter md:text-5xl lg:text-7xl"> Ship <AuroraText>beautiful</AuroraText></h2>Installation
pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/r/aurora-text.json
Copy the Source Code
Copy and paste the following code into your project:
aurora-text.svelte
<script lang="ts"> import type { ClassValue } from "svelte/elements"; import { cn } from "#lib/utils.js"; import type { Snippet } from "svelte";
type AuroraTextProps = { children: Snippet; class?: ClassValue; colors?: string[]; speed?: number; };
let { children, class: className = "", colors = ["#FF0080", "#7928CA", "#0070F3", "#38bdf8"], speed = 1, }: AuroraTextProps = $props();</script>
<span class={cn("relative inline-block", className)}> <span class="sr-only">{@render children()}</span> <span class="animate-aurora relative bg-size-[200%_auto] bg-clip-text text-transparent" aria-hidden="true" style=" background-image: linear-gradient(135deg, {colors.join(', ')}, {colors[0]}); webkit-background-clip: text; webkit-text-fill-color: transparent; animation-duration: {10 / speed}s;" > {@render children()} </span></span> index.ts
import AuroraText from "./aurora-text.svelte";export { AuroraText }; src/routes/layout.css
@theme inline { --animate-aurora: aurora 8s ease-in-out infinite alternate;
@keyframes aurora { 0% { background-position: 0% 50%; transform: rotate(-5deg) scale(0.9); } 25% { background-position: 50% 100%; transform: rotate(5deg) scale(1.1); } 50% { background-position: 100% 50%; transform: rotate(-3deg) scale(0.95); } 75% { background-position: 50% 0%; transform: rotate(3deg) scale(1.05); } 100% { background-position: 0% 50%; transform: rotate(-5deg) scale(0.9); } }}Folder Structure
Folder Structure
src/ └── lib/ └── components/ └── magic/ └── aurora-text/ ├── aurora-text.svelte └── index.tsInstall and integrate the Svelte component documented below.https://sv-animations.vercel.app/magic/docs/components/aurora-text/llms.txt
Follow the guide's installation and usage instructions.Match the project's existing structure, imports, and styles.Keep changes scoped to the component and verify it works.Reply with a short bullet list of completed changes.Usage
<script lang="ts"> import { AuroraText } from "#lib/components/magic/aurora-text/index.js";</script>
<h2 class="text-4xl font-bold"> Build <AuroraText>beautiful</AuroraText> interfaces</h2>Examples
Demo
Follow Rabbit Rabbit
demo-example.svelte
<script lang="ts"> import { AuroraText } from "$lib/components/magic/aurora-text/index.js";</script>
<h2 class="font-figtree text-4xl font-bold tracking-tighter md:text-5xl lg:text-7xl"> Follow <AuroraText colors={["#FF3D3D", "#843DFF", "#3D84FF", "#3DD2FF", "#84FF3D"]}>Rabbit</AuroraText></h2>Props
Aurora Text
An animated gradient text component with flowing aurora colors.
| Name | Type | Default | Description |
|---|---|---|---|
children | Snippet | required | The text content to display with aurora effect |
class | ClassValue | "" | Additional CSS classes to apply |
colors | string[] | ["#FF0080", "#7928CA", "#0070F3", "#38bdf8"] | Array of hex color values for the gradient animation |
speed | number | 1 | Animation speed multiplier (higher = faster) |