diff --git a/content/docs/components/magic-card.mdx b/content/docs/components/magic-card.mdx index 44b98747a..9071da77a 100644 --- a/content/docs/components/magic-card.mdx +++ b/content/docs/components/magic-card.mdx @@ -50,8 +50,9 @@ npx shadcn@latest add "https://magicui.design/r/magic-card" | className | string | - | Additional CSS classes to apply to the card | | gradientSize | number | 200 | Size of the gradient effect | | gradientColor | string | "#262626" | Color of the gradient effect | -| gradientOpacity | number | - | Opacity of the gradient effect | -| gradientColors | string[] | - | Colors of the gradient effect | +| gradientOpacity | number | 0.8 | Opacity of the gradient effect | +| gradientFrom | string | "#9E7AFF" | Start color of the gradient border | +| gradientTo | string | "#FE8BBB" | End color of the gradient border | ## Credits diff --git a/registry/default/example/magic-card-demo.tsx b/registry/default/example/magic-card-demo.tsx index a87e53aa7..5c3c77e15 100644 --- a/registry/default/example/magic-card-demo.tsx +++ b/registry/default/example/magic-card-demo.tsx @@ -13,14 +13,12 @@ export default function MagicCardDemo() { Magic Card diff --git a/registry/default/magicui/magic-card.tsx b/registry/default/magicui/magic-card.tsx index ebc3e27f1..cf5e90a95 100644 --- a/registry/default/magicui/magic-card.tsx +++ b/registry/default/magicui/magic-card.tsx @@ -1,15 +1,16 @@ "use client"; +import { motion, useMotionTemplate, useMotionValue } from "motion/react"; import React, { useCallback, useEffect, useRef } from "react"; -import { motion, useMotionTemplate, useMotionValue } from "framer-motion"; import { cn } from "@/lib/utils"; -export interface MagicCardProps extends React.HTMLAttributes { +interface MagicCardProps extends React.HTMLAttributes { gradientSize?: number; gradientColor?: string; gradientOpacity?: number; - gradientColors?: [string, string, string]; + gradientFrom?: string; + gradientTo?: string; } export function MagicCard({ @@ -18,7 +19,8 @@ export function MagicCard({ gradientSize = 200, gradientColor = "#262626", gradientOpacity = 0.8, - gradientColors = ["#FF0080", "#4096FF", "#78FF78"], + gradientFrom = "#9E7AFF", + gradientTo = "#FE8BBB", }: MagicCardProps) { const cardRef = useRef(null); const mouseX = useMotionValue(-gradientSize); @@ -74,12 +76,9 @@ export function MagicCard({ return (
-
+
{children}