Hover Card
Floating panel that opens on hover
Same BEM classes and behavior as Astro, Svelte, and Vue.
Add this component
The command below includes <strong>Hover Card</strong>—run it in your project directory to install this component (and the CSS if needed). No prompts.
Choose your package manager — click a tab to select, then copy the command.
npx rizzo-css add HoverCard
pnpm dlx rizzo-css add HoverCard
npx rizzo-css add HoverCard
bunx rizzo-css add HoverCard
Live examples
Usage
Usage
Full example for each framework (Astro, Vanilla, Svelte, Vue, React). Switch framework via View as or by clicking a Usage tab—both stay in sync.
Astro Vanilla Svelte Vue React ---
import HoverCard from '../components/astro/HoverCard.astro';
---
<HoverCard triggerLabel="Hover me" client:load>
<p>Hover card content.</p>
</HoverCard>
<!-- Rizzo CSS + hover-card script. data-hover-card-trigger on trigger. -->
<button data-hover-card-trigger="hc1">Hover</button>
<div id="hc1" class="hover-card__content">...</div>
<script>
import { HoverCard } from '$lib/rizzo';
</script>
<HoverCard triggerLabel="Hover me">
<p>Hover card content.</p>
</HoverCard>
<script setup>
import { ref } from 'vue';
import HoverCard from '@/components/rizzo/HoverCard.vue';
import Button from '@/components/rizzo/Button.vue';
</script>
<template>
<HoverCard v-model:open="open">
<template #trigger>
<Button variant="outline">Hover me</Button>
</template>
<p>Hover card content.</p>
</HoverCard>
</template>
import { useState } from 'react';
import { HoverCard, Button } from './components/react';
const [open, setOpen] = useState(false);
<HoverCard open={open} onOpenChange={setOpen} trigger={<Button variant="outline">Hover me</Button>}>
<p>Hover card content.</p>
</HoverCard>
Other frameworks: Astro · Vanilla · Svelte · Vue