Popover
Floating panel triggered by a button
Same BEM classes and behavior as Astro, Svelte, and React.
Add this component
The command below includes <strong>Popover</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 Popover
pnpm dlx rizzo-css add Popover
npx rizzo-css add Popover
bunx rizzo-css add Popover
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 Popover from '../components/astro/Popover.astro';
---
<Popover triggerLabel="Open" client:load>
<p>Popover content.</p>
</Popover>
<!-- Rizzo CSS + popover script. data-popover-trigger on trigger; content in popover__content. -->
<button data-popover-trigger="p1">Open</button>
<div id="p1" class="popover__content">...</div>
<script>
import { Popover, Button } from '$lib/rizzo';
let open = $state(false);
</script>
<Popover bind:open>
{#snippet trigger()}
<Button>Open</Button>
{/snippet}
<p>Popover content.</p>
</Popover>
<script setup>
import { ref } from 'vue';
import Popover from '@/components/rizzo/Popover.vue';
import Button from '@/components/rizzo/Button.vue';
</script>
<template>
<Popover v-model:open="open">
<template #trigger>
<Button>Open</Button>
</template>
<p>Popover content.</p>
</Popover>
</template>
import { useState } from 'react';
import { Popover, Button } from './components/react';
const [open, setOpen] = useState(false);
<Popover open={open} onOpenChange={setOpen} trigger={<Button>Open</Button>}>
<p>Popover content.</p>
</Popover>
Other frameworks: Astro · Vanilla · Svelte · React