BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/wise-ui/spotlight-card

Spotlight Card

wise-ui/spotlight-card
FreeComponent

A card with a spotlight effect that follows the cursor.

Live preview

live · rendered by the registry
Rendered by wise-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://wise-ui.com/r/spotlight-card.json

Source

registry/wise-ui/components/spotlight-card.tsxwise-ui.com/r/spotlight-card.json
1"use client"
2
3import * as React from "react"
4import { motion, useMotionValue, useMotionTemplate } from "motion/react"
5import { cn } from "@/registry/wise-ui/lib/utils"
6
7interface SpotlightCardProps {
8 spotlightColor?: string
9 spotlightSize?: number
10 children: React.ReactNode
11 className?: string
12}
13
14function SpotlightCard({
15 spotlightColor = "rgba(255,255,255,0.08)",
16 spotlightSize = 200,
17 children,
18 className,
19}: SpotlightCardProps) {
20 const mouseX = useMotionValue(0)
21 const mouseY = useMotionValue(0)
22 const [isHovered, setIsHovered] = React.useState(false)
23
24 const background = useMotionTemplate`radial-gradient(${spotlightSize}px circle at ${mouseX}px ${mouseY}px, ${spotlightColor}, transparent 80%)`
25
26 function handleMouseMove(e: React.MouseEvent<HTMLDivElement>) {
27 const rect = e.currentTarget.getBoundingClientRect()
28 mouseX.set(e.clientX - rect.left)
29 mouseY.set(e.clientY - rect.top)
30 }
31
32 return (
33 <div
34 className={cn(
35 "group relative overflow-hidden rounded-xl border border-border bg-card",
36 className
37 )}
38 onMouseMove={handleMouseMove}
39 onMouseEnter={() => setIsHovered(true)}
40 onMouseLeave={() => setIsHovered(false)}
41 >
42 <motion.div
43 className="pointer-events-none absolute inset-0 z-10 transition-opacity duration-300"
44 style={{ background, opacity: isHovered ? 1 : 0 }}
45 />
46 <div className="relative z-20">{children}</div>
47 </div>
48 )
49}
50SpotlightCard.displayName = "SpotlightCard"
51
52export { SpotlightCard }
53export type { SpotlightCardProps }

What it pulls in

npm packages

  • motion
  • clsx
  • tailwind-merge

Files it writes

  • registry/wise-ui/components/spotlight-card.tsx

Facts

Registry
wise-ui
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on wise-ui wise-ui.com r-pathak/wise-ui on GitHub Raw registry item This item as JSON

More from wise-ui

All 20 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Tabsanimated-tabswise-uiComponentsFree3 deps
Border Beamborder-beamwise-uiComponentsFree3 deps
Data Tabledata-tablewise-uiComponentsFree3 deps
Dockdockwise-uiComponentsFree3 deps
Dot Matrixdot-matrixwise-uiComponentsFree2 deps
Editable Texteditable-textwise-uiComponentsFree4 deps
Gradient Sidebargradient-sidebarwise-uiComponentsFree3 deps
Kanban Boardkanban-boardwise-uiComponentsFree6 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex