Comet Card
NewAn image card with hover zoom, optional rotating gradient border, and 3D tilt effect that responds to cursor position.
Default Variant
Simple image card with smooth hover zoom. No border effects.
Mountain Vista
Serene alpine landscape bathed in golden hour light.
Starlit Peaks
A breathtaking view of snow-capped mountains under the night sky.
Forest Mist
Fog rolling through a dense old-growth forest at dawn.
Comet Variant
InteractiveHover over the cards to reveal the rotating rainbow border and 3D tilt effect. Click any card to test the click handler.
Mountain Vista
Serene alpine landscape bathed in golden hour light.
Starlit Peaks
A breathtaking view of snow-capped mountains under the night sky.
Forest Mist
Fog rolling through a dense old-growth forest at dawn.
Ocean Horizon
Where the sea meets the sky in an infinite gradient of blue.
Installation
Install the comet-card component via the shadcn CLI:
npx shadcn@latest add "https://dexterityui.vercel.app/r/comet-card.json"No additional dependencies required beyond clsx and tailwind-merge.
Props
| Prop | Type | Description |
|---|---|---|
imageUrlrequired | string | URL of the card image. |
titlerequired | string | Card title displayed below the image. |
descriptionrequired | string | Short description text. |
badge | string | Optional badge text overlaid on the image. |
variant | "default" | "comet" | Card style variant. Defaults to "default". |
onClick | MouseEventHandler | Click handler — makes the card interactive & keyboard-navigable. |
imageAlt | string | Custom alt text for the image. Defaults to title. |
className | string | Additional classes merged via cn(). |
Accessibility
Source
"use client";
import * as React from "react";
import { cn } from "@/lib/utils";
export interface CometCardProps extends React.HTMLAttributes<HTMLDivElement> {
imageUrl: string;
title: string;
description: string;
badge?: string;
variant?: "default" | "comet";
onClick?: React.MouseEventHandler<HTMLDivElement>;
imageAlt?: string;
}
const CometCard = React.forwardRef<HTMLDivElement, CometCardProps>(
({ imageUrl, title, description, badge, variant = "default",
onClick, imageAlt, className, ...props }, ref) => {
// ... full source at registry/default/comet-card/comet-card.tsx
}
);