Cards with animated SVG paths that draw themselves on hover, built with motion. Drop in your own paths, colors, and images.
Project description
Discover beautiful landscapes around the world.
Scale the highest reaches and breathe in the crisp mountain air.
Navigate the vibrant energy of the world's most iconic skylines.
Find serenity where the crystal clear ocean meets white sands.
Experience the quiet majesty of shifting dunes and open skies.
Lose yourself in the lush greenery of untamed woodland trails.
Witness the brilliance of the Milky Way from the dark wilderness.
$ npx shadcn@latest add https://akshitr.com/r/trace-card.json
import { TraceCard } from "@/components/trace-card";
export default function TraceCardDemo() {
return (
<TraceCard
className="h-64 w-64"
image="https://images.unsplash.com/photo-1448375240586-882707db888b?w=800&auto=format&fit=crop&q=80"
>
<div className="text-white">
<h2 className="text-2xl font-bold">Project Title</h2>
<p className="text-sm">Project description</p>
</div>
</TraceCard>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
| image | string | — | The image source URL for the card background. |
| title? | string | — | Optional title used for accessibility (alt text). |
| stroke? | string | "#ff6b6b" | Primary color of the animated SVG stroke. |
| baseStroke? | string | "#e5e5e5" | Secondary/base stroke color (background path layer). |
| paths? | { d: string; viewBox: string }[] | DEFAULT_PATHS | Custom SVG path configurations for the animated lines. |
| renderImage? | (props: { src: string; alt?: string }) => React.ReactNode | — | Custom renderer for the image (e.g. Next.js <Image />). |
| children? | React.ReactNode | — | Content displayed inside the card (usually text or UI elements). |
| className? | string | — | Additional CSS classes for styling the root container. |