Skip to content

UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.

feat: aurora text component added (#502)

Arghya Dascf737807f949
diff --git a/__registry__/index.tsx b/__registry__/index.tsx
index 5dc33163..9b9ef06a 100644
--- a/__registry__/index.tsx
+++ b/__registry__/index.tsx
@@ -57,6 +57,19 @@ export const Index: Record<string, any> = {
subcategory: "undefined",
chunks: [],
},
+ "aurora-text": {
+ name: "aurora-text",
+ type: "registry:ui",
+ registryDependencies: undefined,
+ files: ["registry/default/magicui/aurora-text.tsx"],
+ component: React.lazy(
+ () => import("@/registry/default/magicui/aurora-text.tsx"),
+ ),
+ source: "",
+ category: "undefined",
+ subcategory: "undefined",
+ chunks: [],
+ },
"morphing-text": {
name: "morphing-text",
type: "registry:ui",
@@ -854,6 +867,19 @@ export const Index: Record<string, any> = {
subcategory: "undefined",
chunks: [],
},
+ "aurora-text-demo": {
+ name: "aurora-text-demo",
+ type: "registry:example",
+ registryDependencies: ["aurora-text"],
+ files: ["registry/default/example/aurora-text-demo.tsx"],
+ component: React.lazy(
+ () => import("@/registry/default/example/aurora-text-demo.tsx"),
+ ),
+ source: "",
+ category: "undefined",
+ subcategory: "undefined",
+ chunks: [],
+ },
"morphing-text-demo": {
name: "morphing-text-demo",
type: "registry:example",
diff --git a/config/docs.ts b/config/docs.ts
index c22aa394..0e278803 100644
--- a/config/docs.ts
+++ b/config/docs.ts
@@ -325,6 +325,12 @@ export const docsConfig: DocsConfig = {
items: [],
label: "New",
},
+ {
+ title: "Aurora Text",
+ href: `/docs/components/aurora-text`,
+ items: [],
+ label: "New",
+ },
{
title: "Number Ticker",
href: `/docs/components/number-ticker`,
diff --git a/content/docs/components/aurora-text.mdx b/content/docs/components/aurora-text.mdx
new file mode 100644
index 00000000..f7e5b42e
--- /dev/null
+++ b/content/docs/components/aurora-text.mdx
@@ -0,0 +1,91 @@
+---
+title: Aurora Text
+date: 2025-01-12
+description: A beautiful aurora text effect
+author: Dillon
+published: true
+---
+
+<ComponentPreview name="aurora-text-demo" />
+
+## Installation
+
+<Tabs defaultValue="cli">
+
+<TabsList>
+ <TabsTrigger value="cli">CLI</TabsTrigger>
+ <TabsTrigger value="manual">Manual</TabsTrigger>
+</TabsList>
+<TabsContent value="cli">
+
+```bash
+npx shadcn@latest add "https://magicui.design/r/aurora-text"
+```
+
+</TabsContent>
+
+<TabsContent value="manual">
+
+<Steps>
+
+<Step>Copy and paste the following code into your project.</Step>
+
+<ComponentSource name="aurora-text" />
+
+<Step>Update the import paths to match your project setup.</Step>
+
+<Step>Update `tailwind.config.js`</Step>
+
+Add the following animations to your `tailwind.config.js` file:
+
+```js title="tailwind.config.js" {5-32}
+/** @type {import('tailwindcss').Config} */
+module.exports = {
+ theme: {
+ extend: {
+ keyframes: {
+ "aurora-border": {
+ "0%, 100%": { borderRadius: "37% 29% 27% 27% / 28% 25% 41% 37%" },
+ "25%": { borderRadius: "47% 29% 39% 49% / 61% 19% 66% 26%" },
+ "50%": { borderRadius: "57% 23% 47% 72% / 63% 17% 66% 33%" },
+ "75%": { borderRadius: "28% 49% 29% 100% / 93% 20% 64% 25%" },
+ },
+ "aurora-1": {
+ "0%, 100%": { top: "0", right: "0" },
+ "50%": { top: "50%", right: "25%" },
+ "75%": { top: "25%", right: "50%" },
+ },
+ "aurora-2": {
+ "0%, 100%": { top: "0", left: "0" },
+ "60%": { top: "75%", left: "25%" },
+ "85%": { top: "50%", left: "50%" },
+ },
+ "aurora-3": {
+ "0%, 100%": { bottom: "0", left: "0" },
+ "40%": { bottom: "50%", left: "25%" },
+ "65%": { bottom: "25%", left: "50%" },
+ },
+ "aurora-4": {
+ "0%, 100%": { bottom: "0", right: "0" },
+ "50%": { bottom: "25%", right: "40%" },
+ "90%": { bottom: "50%", right: "25%" },
+ },
+ },
+ },
+ },
+};
+```
+
+</Steps>
+
+</TabsContent>
+
+</Tabs>
+
+## Props
+
+| Prop | Type | Default | Description |
+| ----------- | ------------------- | -------- | --------------------------------------------- |
+| `className` | `string` | `-` | The class name to be applied to the component |
+| `children` | `ReactNode` | `-` | Children elements |
+| `as` | `React.ElementType` | `"span"` | The element type to render as |
diff --git a/public/r/index.json b/public/r/index.json
index 9ecd5ce1..310e26e3 100644
--- a/public/r/index.json
+++ b/public/r/index.json
@@ -48,6 +48,99 @@
}
]
},
+ {
+ "name": "aurora-text",
+ "type": "registry:ui",
+ "dependencies": [
+ "motion"
+ ],
+ "files": [
+ {
+ "path": "magicui/aurora-text.tsx",
+ "type": "registry:ui"
+ }
+ ],
+ "tailwind": {
+ "config": {
+ "theme": {
+ "extend": {
+ "keyframes": {
+ "aurora-border": {
+ "0%, 100%": {
+ "borderRadius": "37% 29% 27% 27% / 28% 25% 41% 37%"
+ },
+ "25%": {
+ "borderRadius": "47% 29% 39% 49% / 61% 19% 66% 26%"
+ },
+ "50%": {
+ "borderRadius": "57% 23% 47% 72% / 63% 17% 66% 33%"
+ },
+ "75%": {
+ "borderRadius": "28% 49% 29% 100% / 93% 20% 64% 25%"
+ }
+ },
+ "aurora-1": {
+ "0%, 100%": {
+ "top": "0",
+ "right": "0"
+ },
+ "50%": {
+ "top": "50%",
+ "right": "25%"
+ },
+ "75%": {
+ "top": "25%",
+ "right": "50%"
+ }
+ },
+ "aurora-2": {
+ "0%, 100%": {
+ "top": "0",
+ "left": "0"
+ },
+ "60%": {
+ "top": "75%",
+ "left": "25%"
+ },
+ "85%": {
+ "top": "50%",
+ "left": "50%"
+ }
+ },
+ "aurora-3": {
+ "0%, 100%": {
+ "bottom": "0",
+ "left": "0"
+ },
+ "40%": {
+ "bottom": "50%",
+ "left": "25%"
+ },
+ "65%": {
+ "bottom": "25%",
+ "left": "50%"
+ }
+ },
+ "aurora-4": {
+ "0%, 100%": {
+ "bottom": "0",
+ "right": "0"
+ },
+ "50%": {
+ "bottom": "25%",
+ "right": "40%"
+ },
+ "90%": {
+ "bottom": "50%",
+ "right": "25%"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
{
"name": "morphing-text",
"type": "registry:ui",
diff --git a/public/r/styles/default/aurora-text.json b/public/r/styles/default/aurora-text.json
new file mode 100644
index 00000000..d2677373
--- /dev/null
+++ b/public/r/styles/default/aurora-text.json
@@ -0,0 +1,95 @@
+{
+ "name": "aurora-text",
+ "type": "registry:ui",
+ "dependencies": [
+ "motion"
+ ],
+ "files": [
+ {
+ "path": "magicui/aurora-text.tsx",
+ "content": "import { cn } from \"@/lib/utils\";\nimport { motion, MotionProps } from \"motion/react\";\nimport React from \"react\";\n\ninterface AuroraTextProps\n extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps> {\n className?: string;\n children: React.ReactNode;\n as?: React.ElementType;\n}\n\nexport function AuroraText({\n className,\n children,\n as: Component = \"span\",\n ...props\n}: AuroraTextProps) {\n const MotionComponent = motion.create(Component);\n\n return (\n <MotionComponent\n className={cn(\"relative inline-flex overflow-hidden\", className)}\n {...props}\n >\n {children}\n <span className=\"pointer-events-none absolute inset-0 mix-blend-lighten dark:mix-blend-darken\">\n <span className=\"pointer-events-none absolute -top-1/2 h-[30vw] w-[30vw] animate-[aurora-border_6s_ease-in-out_infinite,aurora-1_12s_ease-in-out_infinite_alternate] bg-[hsl(var(--color-1))] mix-blend-overlay blur-[1rem]\"></span>\n <span className=\"pointer-events-none absolute right-0 top-0 h-[30vw] w-[30vw] animate-[aurora-border_6s_ease-in-out_infinite,aurora-2_12s_ease-in-out_infinite_alternate] bg-[hsl(var(--color-2))] mix-blend-overlay blur-[1rem]\"></span>\n <span className=\"pointer-events-none absolute bottom-0 left-0 h-[30vw] w-[30vw] animate-[aurora-border_6s_ease-in-out_infinite,aurora-3_12s_ease-in-out_infinite_alternate] bg-[hsl(var(--color-3))] mix-blend-overlay blur-[1rem]\"></span>\n <span className=\"pointer-events-none absolute -bottom-1/2 right-0 h-[30vw] w-[30vw] animate-[aurora-border_6s_ease-in-out_infinite,aurora-4_12s_ease-in-out_infinite_alternate] bg-[hsl(var(--color-4))] mix-blend-overlay blur-[1rem]\"></span>\n </span>\n </MotionComponent>\n );\n}\n",
+ "type": "registry:ui",
+ "target": ""
+ }
+ ],
+ "tailwind": {
+ "config": {
+ "theme": {
+ "extend": {
+ "keyframes": {
+ "aurora-border": {
+ "0%, 100%": {
+ "borderRadius": "37% 29% 27% 27% / 28% 25% 41% 37%"
+ },
+ "25%": {
+ "borderRadius": "47% 29% 39% 49% / 61% 19% 66% 26%"
+ },
+ "50%": {
+ "borderRadius": "57% 23% 47% 72% / 63% 17% 66% 33%"
+ },
+ "75%": {
+ "borderRadius": "28% 49% 29% 100% / 93% 20% 64% 25%"
+ }
+ },
+ "aurora-1": {
+ "0%, 100%": {
+ "top": "0",
+ "right": "0"
+ },
+ "50%": {
+ "top": "50%",
+ "right": "25%"
+ },
+ "75%": {
+ "top": "25%",
+ "right": "50%"
+ }
+ },
+ "aurora-2": {
+ "0%, 100%": {
+ "top": "0",
+ "left": "0"
+ },
+ "60%": {
+ "top": "75%",
+ "left": "25%"
+ },
+ "85%": {
+ "top": "50%",
+ "left": "50%"
+ }
+ },
+ "aurora-3": {
+ "0%, 100%": {
+ "bottom": "0",
+ "left": "0"
+ },
+ "40%": {
+ "bottom": "50%",
+ "left": "25%"
+ },
+ "65%": {
+ "bottom": "25%",
+ "left": "50%"
+ }
+ },
+ "aurora-4": {
+ "0%, 100%": {
+ "bottom": "0",
+ "right": "0"
+ },
+ "50%": {
+ "bottom": "25%",
+ "right": "40%"
+ },
+ "90%": {
+ "bottom": "50%",
+ "right": "25%"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/registry/default/example/aurora-text-demo.tsx b/registry/default/example/aurora-text-demo.tsx
new file mode 100644
index 00000000..08305036
--- /dev/null
+++ b/registry/default/example/aurora-text-demo.tsx
@@ -0,0 +1,9 @@
+import { AuroraText } from "@/registry/default/magicui/aurora-text";
+
+export default function AuroraTextDemo() {
+ return (
+ <h1 className="text-4xl font-bold tracking-tighter md:text-5xl lg:text-7xl">
+ Ship <AuroraText>beautiful</AuroraText>
+ </h1>
+ );
+}
diff --git a/registry/default/magicui/aurora-text.tsx b/registry/default/magicui/aurora-text.tsx
new file mode 100644
index 00000000..76758df2
--- /dev/null
+++ b/registry/default/magicui/aurora-text.tsx
@@ -0,0 +1,34 @@
+import { cn } from "@/lib/utils";
+import { motion, MotionProps } from "motion/react";
+import React from "react";
+
+interface AuroraTextProps
+ extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps> {
+ className?: string;
+ children: React.ReactNode;
+ as?: React.ElementType;
+}
+
+export function AuroraText({
+ className,
+ children,
+ as: Component = "span",
+ ...props
+}: AuroraTextProps) {
+ const MotionComponent = motion.create(Component);
+
+ return (
+ <MotionComponent
+ className={cn("relative inline-flex overflow-hidden", className)}
+ {...props}
+ >
+ {children}
+ <span className="pointer-events-none absolute inset-0 mix-blend-lighten dark:mix-blend-darken">
+ <span className="pointer-events-none absolute -top-1/2 h-[30vw] w-[30vw] animate-[aurora-border_6s_ease-in-out_infinite,aurora-1_12s_ease-in-out_infinite_alternate] bg-[hsl(var(--color-1))] mix-blend-overlay blur-[1rem]"></span>
+ <span className="pointer-events-none absolute right-0 top-0 h-[30vw] w-[30vw] animate-[aurora-border_6s_ease-in-out_infinite,aurora-2_12s_ease-in-out_infinite_alternate] bg-[hsl(var(--color-2))] mix-blend-overlay blur-[1rem]"></span>
+ <span className="pointer-events-none absolute bottom-0 left-0 h-[30vw] w-[30vw] animate-[aurora-border_6s_ease-in-out_infinite,aurora-3_12s_ease-in-out_infinite_alternate] bg-[hsl(var(--color-3))] mix-blend-overlay blur-[1rem]"></span>
+ <span className="pointer-events-none absolute -bottom-1/2 right-0 h-[30vw] w-[30vw] animate-[aurora-border_6s_ease-in-out_infinite,aurora-4_12s_ease-in-out_infinite_alternate] bg-[hsl(var(--color-4))] mix-blend-overlay blur-[1rem]"></span>
+ </span>
+ </MotionComponent>
+ );
+}
diff --git a/registry/registry-examples.ts b/registry/registry-examples.ts
index 065cbff9..05d46a31 100644
--- a/registry/registry-examples.ts
+++ b/registry/registry-examples.ts
@@ -37,6 +37,12 @@ export const examples: Registry = [
registryDependencies: ["line-shadow-text"],
files: ["example/line-shadow-text-demo.tsx"],
},
+ {
+ name: "aurora-text-demo",
+ type: "registry:example",
+ registryDependencies: ["aurora-text"],
+ files: ["example/aurora-text-demo.tsx"],
+ },
{
name: "morphing-text-demo",
type: "registry:example",
diff --git a/registry/registry-ui.ts b/registry/registry-ui.ts
index d651c91b..d999c2fa 100644
--- a/registry/registry-ui.ts
+++ b/registry/registry-ui.ts
@@ -24,6 +24,50 @@ export const ui: Registry = [
dependencies: ["motion"],
files: ["magicui/line-shadow-text.tsx"],
},
+ {
+ name: "aurora-text",
+ type: "registry:ui",
+ dependencies: ["motion"],
+ files: ["magicui/aurora-text.tsx"],
+ tailwind: {
+ config: {
+ theme: {
+ extend: {
+ keyframes: {
+ "aurora-border": {
+ "0%, 100%": {
+ borderRadius: "37% 29% 27% 27% / 28% 25% 41% 37%",
+ },
+ "25%": { borderRadius: "47% 29% 39% 49% / 61% 19% 66% 26%" },
+ "50%": { borderRadius: "57% 23% 47% 72% / 63% 17% 66% 33%" },
+ "75%": { borderRadius: "28% 49% 29% 100% / 93% 20% 64% 25%" },
+ },
+ "aurora-1": {
+ "0%, 100%": { top: "0", right: "0" },
+ "50%": { top: "50%", right: "25%" },
+ "75%": { top: "25%", right: "50%" },
+ },
+ "aurora-2": {
+ "0%, 100%": { top: "0", left: "0" },
+ "60%": { top: "75%", left: "25%" },
+ "85%": { top: "50%", left: "50%" },
+ },
+ "aurora-3": {
+ "0%, 100%": { bottom: "0", left: "0" },
+ "40%": { bottom: "50%", left: "25%" },
+ "65%": { bottom: "25%", left: "50%" },
+ },
+ "aurora-4": {
+ "0%, 100%": { bottom: "0", right: "0" },
+ "50%": { bottom: "25%", right: "40%" },
+ "90%": { bottom: "50%", right: "25%" },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
{
name: "morphing-text",
type: "registry:ui",
diff --git a/tailwind.config.cjs b/tailwind.config.cjs
index ea12c0cc..207b587f 100644
--- a/tailwind.config.cjs
+++ b/tailwind.config.cjs
@@ -212,6 +212,32 @@ module.exports = {
"0%": { "background-position": "0 0" },
"100%": { "background-position": "100% -100%" },
},
+ "aurora-border": {
+ "0%, 100%": { borderRadius: "37% 29% 27% 27% / 28% 25% 41% 37%" },
+ "25%": { borderRadius: "47% 29% 39% 49% / 61% 19% 66% 26%" },
+ "50%": { borderRadius: "57% 23% 47% 72% / 63% 17% 66% 33%" },
+ "75%": { borderRadius: "28% 49% 29% 100% / 93% 20% 64% 25%" },
+ },
+ "aurora-1": {
+ "0%, 100%": { top: "0", right: "0" },
+ "50%": { top: "50%", right: "25%" },
+ "75%": { top: "25%", right: "50%" },
+ },
+ "aurora-2": {
+ "0%, 100%": { top: "0", left: "0" },
+ "60%": { top: "75%", left: "25%" },
+ "85%": { top: "50%", left: "50%" },
+ },
+ "aurora-3": {
+ "0%, 100%": { bottom: "0", left: "0" },
+ "40%": { bottom: "50%", left: "25%" },
+ "65%": { bottom: "25%", left: "50%" },
+ },
+ "aurora-4": {
+ "0%, 100%": { bottom: "0", right: "0" },
+ "50%": { bottom: "25%", right: "40%" },
+ "90%": { bottom: "50%", right: "25%" },
+ },
},
},
},