Skip to main content
A card component with a dynamic spotlight effect that follows the mouse cursor, creating an engaging and interactive visual experience.

Installation

npx inspira-ui add card-spotlight

Usage

<template>
  <CardSpotlight
    :gradient-size="200"
    gradient-color="#262626"
    :gradient-opacity="0.8"
  >
    <h3>Your content here</h3>
    <p>The spotlight will follow your mouse cursor.</p>
  </CardSpotlight>
</template>

<script setup>
import { CardSpotlight } from '@/components/ui/card-spotlight'
</script>

Props

Prop NameTypeDefaultDescription
gradientSizenumber200Radius in pixels of the spotlight effect.
gradientColorstring'#262626'The color of the spotlight gradient.
gradientOpacitynumber0.8The opacity level of the spotlight gradient effect.
slotClassstringundefinedClass to apply to the parent container containing the slot.

Credits

Inspired by Magic Card component from Magic UI.

Build docs developers (and LLMs) love