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-card

Needs 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

PropTypeDefault
openboolean

Whether the popup is open. Pair it with onOpenChange to control it.

—

Also takes every prop of Base UI's preview card, plus className and style.

PreviewCard.Popup

PropTypeDefault
sideBasePreviewCard.Positioner.Props["side"]

Which side of the trigger the popup opens on.

"bottom"
sideOffsetnumber

Gap between the trigger and the popup, in pixels.

10
theme"light" | "dark"

Light or dark glass. Falls back to the nearest GlassThemeProvider, then light.

—
refraction"interactive" | "always"

When the glass bends the page. interactive bends it while the component is pressed, dragged or focused, always bends it all the time.

"interactive"
childrenReactNode

The content.

—

Also takes every prop of Base UI's preview card, plus className and style.