V-/Srcv0.1.0beta
// popover
Anchored glass panel for small forms and detail.
npx shadcn add @vsrc/popoverOnly the vsrc surface is documented here. Everything else passes through to Radix Popover.
// PopoverContent
| prop | type | default | notes |
|---|---|---|---|
| glass | "subtle" | "regular" | "heavy" | LiquidGlassOptions | false | — | Optics override for the panel. A preset name replaces the tuned values, an object merges over them, `false` disables refraction entirely. |
Forwards `glass` to GlassSurface — engine defaults. Panel-sized, statically positioned once open: the ideal refraction case.
The exact file the CLI copies into your project — you own it after install.
"use client";
import * as React from "react";
import * as PopoverPrimitive from "@radix-ui/react-popover";
import type { GlassPreset, LiquidGlassOptions } from "vsrc/react";
import { GlassSurface } from "@/registry/vsrc/ui/glass-surface";
import { cn } from "@/lib/utils";
const Popover = PopoverPrimitive.Root;
const PopoverTrigger = PopoverPrimitive.Trigger;
const PopoverAnchor = PopoverPrimitive.Anchor;
function PopoverContent({
className,
align = "center",
sideOffset = 8,
glass,
...props
}: React.ComponentProps<typeof PopoverPrimitive.Content> & { glass?: LiquidGlassOptions | GlassPreset | false }) {
return (
<PopoverPrimitive.Portal>
<GlassSurface asChild glass={glass}>
<PopoverPrimitive.Content
data-slot="popover-content"
align={align}
sideOffset={sideOffset}
className={cn("animate-glass-in relative z-50 w-72 p-4 text-foreground outline-none", className)}
{...props}
/>
</GlassSurface>
</PopoverPrimitive.Portal>
);
}
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };