Preview Card
A preview that buds off a link while you hover it.
Read about Liquid glass before you design with it.
Installation#
pnpmnpmyarnbun
$ pnpm dlx shadcn@latest add @liquikit/preview-cardNeeds the @liquikit registry in your components.json. Set it up once.
Usage#
import { PreviewCard } from "@/components/liquikit/preview-card"<PreviewCard.Root>
<PreviewCard.Trigger href="/glass">Liquid glass</PreviewCard.Trigger>
<PreviewCard.Popup>A material that bends what is behind it.</PreviewCard.Popup>
</PreviewCard.Root>API Reference#
PreviewCard.Root
| Prop | Type | Default |
|---|---|---|
open | booleanWhether the popup is open. Pair it with | — |
Also takes every prop of Base UI's preview card, plus className and style.
PreviewCard.Popup
| Prop | Type | Default |
|---|---|---|
side | BasePreviewCard.Positioner.Props["side"]Which side of the trigger the popup opens on. | "bottom" |
sideOffset | numberGap between the trigger and the popup, in pixels. | 10 |
theme | "light" | "dark"Light or dark glass. Falls back to the nearest | — |
refraction | "interactive" | "always"When the glass bends the page. | "interactive" |
children | ReactNodeThe content. | — |
Also takes every prop of Base UI's preview card, plus className and style.