A card that answers the pointer with shape and light. The nearest corner rounds, a rim light and a soft glow follow the pointer, and a status lights the rim and rounds the icon tile into a ball.
Push approved expenses to your ledger every night, mapped to your own categories.
Connected
Receipt capture
Forward a photo or a PDF and the amount, date and vendor fill themselves in.
Policy checks
Flag spend above a limit or outside a category before it reaches a reviewer.
spotlight-card · , lively
spotlight-card-demo.tsx
When to use
Use it wherever a shadcn Card sits in a grid and should answer the pointer. Group cards in SpotlightCardGroup so neighbours react too; the group plays one sweep when it first scrolls into view.
When not to use
For a card that opens into a detail view use Morphing Dialog. On very dense data screens a plain card or Data Table is calmer.
Use it wherever a shadcn Card sits in a grid and should feel held: integration lists, feature
grids, plan pickers, connector settings, project cards. The card answers with shape and light: the
corner nearest the pointer rounds out, the opposite corner squares, the shadow moves to the far
side, and a spot of the ring color lights the 1 px rim and, faintly, the inside under the
pointer. Put cards in a SpotlightCardGroup and the whole grid looks at the pointer: neighbours
round the corner that faces it and light the edge nearest to it, less the farther away they are.
The group plays one sweep the first time it scrolls into view: a virtual pointer crosses from the
first card to the last, lighting each rim on its way, then leaves. After that the cards stay still
until someone points at them, so the effect reads once without any interaction.
feature (default): icon tile, title, description and a footer with actions.
plan: the whole card is a button (the choice). Put the price and the plan's lines inside.
connector: one row with the icon tile, the name and a status, and a control such as a Switch
in the footer at the end. By default the card itself is not pressable and its control is; with
interactive the whole row is the control (the Connections example toggles a connection with
aria-pressed and shows the result with status).
interactive makes the card a button named by its title. Pressing it rounds all four corners
and sinks the card; keyboard focus shows the same rounded pose plus the focus ring. Wrap a link
with asChild to make the card a link:
status says what the card stands for, so the card itself shows the consequence of its control:
idle (default): the resting card.
pending: the rim pulses in the ring color while work runs (a connection, a sync) and the card
is aria-busy. The pulse stops off screen and in a hidden tab; with reduced motion the rim stays
lit instead.
active: connected, selected or on. The rim stays lit and the icon tile settles into a ring-tinted
ball. Pair it with your own state text (a StatusBadge) and, on an interactive card,
aria-pressed or aria-current.
The temperament sets how far the corners move, never the card's look at rest. At calm the near
corner reaches about 20 px and the shadow moves 2 px, which is right for dense settings pages. At
lively it reaches about 41 px, and at playful 48 px, with a small overshoot when the pointer
leaves. The light is the same at every temperament. tilt adds a turn toward the pointer. It is off by default; use it only for one or two
showcase cards, never with a large group.
Moves to an interactive card or to the controls inside a card
Enter
Activates an interactive card
Space
Holds the pressed pose of a button card; releasing it activates the card
An interactive card is a real button (or your link with asChild), named by its title.
Content cards are plain containers: only the controls inside them are focusable.
Keyboard focus moves the group's pointer to the focused element, so keyboard users see the same
corner response as mouse users. A focused interactive card takes the rounded "held" pose.
The inner glow is at most 12% of the ring color behind the text, so title and description keep
AA contrast at every frame. The rim light sits on the 1 px border only.
The shadow layer, the rim light and the icon tile are decorative and hidden from assistive
technology.
status="pending" sets aria-busy. The status itself is visual: say it in text too (a badge
with announce, or aria-pressed on an interactive card).
On touch screens the corners and the light follow the finger while it is down and fade when it
lifts or the page scrolls, so the effect has a touch alternative.
One eased pointer per group drives four border-radius values per card, a transform on a
separate shadow layer and four CSS variables for the light (two gradients, no extra layers per
frame). React never re-renders while the pointer moves.
Card positions are measured when the pointer enters, on focus, and after a resize or a scroll,
never per frame.
The sweep plays once, only when the group is on screen and the tab is visible.
Peer dependencies: motion and @radix-ui/react-slot (only for asChild).
Reduced motion: the corners stay at 12 px and nothing moves. The light still follows the
pointer (it changes color, not position), hover deepens the shadow, press tints the card, focus
shows the ring, and pending shows a steady lit rim instead of the pulse.
Technical sheet
Motion
calm
260 ms · bounce 0
lively
400 ms · bounce 0.3
playful
540 ms · bounce 0.45
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Size
Not measured yet · budget 6.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, motion, @radix-ui/react-slot.
Dependencies
@radix-ui/react-slot · peer
motion · peer
Triggers
pointer movement, press, keyboard focus, entering the viewport
Reduced motion
Corners stay at 12 px and nothing moves; the rim light and glow still follow the pointer (light, not movement), press tints the card, focus shows the ring, pending shows a steady lit rim instead of a pulse. No sweep.
Keyboard
Tab
Moves to an interactive card or to the controls inside a card; the grid turns its corners toward the focused element
Enter
Activates an interactive card (button or link)
Space
Holds the pressed pose of an interactive button card; release activates it
Browsers
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)