Spotlight Card
Card surface with a crisp spotlight that tracks the cursor and fades in on hover. Built on Cursor Glow and design tokens.
Example
Installation
npx shadcn@latest add https://hirael.com/r/spotlight-card.jsonUsage
import { SpotlightCard } from "@/components/spotlight-card"Paths assume the default @/ alias from your components.json. The example above shows the parts composed.
API
<SpotlightCard />
+ native element props| Prop | Type | Default |
|---|---|---|
sizeDiameter of the glow, in px. | number | 350 |
colorGlow color. Defaults to a soft tint of the foreground token. | string | 'color-mix(in oklch, var(--foreground) 10%, transparent)' |
blurSoften the glow's edge. Turn off for a crisper spotlight. | boolean | false |
Component source
import { cn } from '@/lib/utils';
import { CursorGlow, type CursorGlowProps } from '@/registry/hirael/bases/radix/components/cursor-glow';
export type SpotlightCardProps = CursorGlowProps;
/** A card surface with a crisp cursor spotlight: Cursor Glow with card styling and no blur. */
const SpotlightCard = ({
className,
size = 350,
color = 'color-mix(in oklch, var(--foreground) 10%, transparent)',
blur = false,
...props
}: SpotlightCardProps) => {
return (
<CursorGlow
data-slot="spotlight-card"
size={size}
color={color}
blur={blur}
className={cn('rounded-lg border border-border bg-card text-card-foreground', className)}
{...props}
/>
);
};
export { SpotlightCard };
Dependencies
shadcn registry
cursor-glow