Detent web components
By Shane Logsdon

Media & effects

Spotlight Card

Implemented

Radial pointer tracking over dark layered surface

detent-spotlight-card

Port status
Catalog status
implemented
Origin
upstream
Phase
4
Wave
phase-4-pointer
Group
Media & effects

Edge Computing

Deploy globally distributed stateful workloads in 35 regions.

2.8 KB gzip for the class module

Variants

Tighter beam

A narrower radius with a violet inner glow.

Move the pointer over a card: the border beam and the ambient glow follow it, written as two CSS custom properties per pointer sample — no animation frame runs while the pointer is still. This card uses a smaller radius and a different colour than the one above. The paragraph text is readable without any pointer interaction, and both cards use fixed example copy.

Recorded states

  • hover recorded state; no setter
  • idle recorded state; no setter

Usage

Import

import '/components/spotlight-card/define.js';

// or register it yourself
import { DetentSpotlightCard } from '/components/spotlight-card/spotlight-card.js';

Attributes

  • spotlight-color
  • spotlight-size

Properties

  • spotlightColor
  • spotlightSize

Slots

  • default

Events

No events are recorded for this component.

Example

Runnable example: site/examples/spotlight-card.ts. The snippet below is generated from the catalogued attributes.

<detent-spotlight-card
  spotlight-color="rgba(56, 189, 248, 0.08)"
  spotlight-size="350"
></detent-spotlight-card>

Source

The pinned upstream source for this row:

  • src/components/ui/SpotlightCard.tsx sha256 9d86686433de…

Native files

The native module and its artifacts:

  • src/components/spotlight-card/spotlight-card.ts
  • src/components/spotlight-card/styles.css
  • src/components/spotlight-card/define.ts
  • docs/components/spotlight-card.md
  • site/examples/spotlight-card.ts
  • tests/browser/spotlight-card.spec.ts
  • evidence/components/spotlight-card.md

API

Boolean attributes follow HTML presence semantics: present means true, absent means false, and disabled="false" still means disabled.

Attributes

Attributes
AttributePropertyTypeDefaultNotes
spotlight-colorspotlightColorstring'rgba(56, 189, 248, 0.08)'Kebab-case attribute; camelCase property.
spotlight-sizespotlightSizenumber350Kebab-case attribute; camelCase property.

Properties

Properties
PropertyTypeDefaultNotes
spotlightColorstring'rgba(56, 189, 248, 0.08)'Property-only: assign from script; not accepted as an attribute.
spotlightSizenumber350Property-only: assign from script; not accepted as an attribute.

Events

No custom events are recorded for this component.

Slots

Slots
SlotNotes
defaultConsumer content; rendered through a slot, never re-created.

CSS customisation

  • Framer Motion springs/AnimatePresence ported to CSS transitions, WAAPI or the shared rAF spring helper.
  • React state/hooks replaced by element-owned state with pre-upgrade property preservation.
  • Pointer coordinates clamp to the card box.
  • Reduced motion centres the spotlight and removes the fade.
  • spotlight-color is validated with CSS.supports and spotlight-size clamps to 0..2000, each warning once on invalid input.
  • The idle/hover state vocabulary is pinned here because the row recorded only a state-scope gap.

What it does

A near-black layered card illuminated by two decorative radial layers that track the pointer: a narrow white border beam and a wider ambient inner glow.

Upstream behaviour
  • Hardware-accelerated dynamic radial mask
  • Dual illumination (border beam + ambient inner glow)
  • Near-black layered background preservation
Differences from upstream
  • Framer Motion springs/AnimatePresence ported to CSS transitions, WAAPI or the shared rAF spring helper.
  • React state/hooks replaced by element-owned state with pre-upgrade property preservation.
  • Pointer coordinates clamp to the card box.
  • Reduced motion centres the spotlight and removes the fade.
  • spotlight-color is validated with CSS.supports and spotlight-size clamps to 0..2000, each warning once on invalid input.
  • The idle/hover state vocabulary is pinned here because the row recorded only a state-scope gap.
Previous: Split Button Next: Spotlight Search

Docs

Components

Project