Preview
An anchored rich preview displayed from a link or trigger.
An anchored rich preview displayed from a link or trigger.
Backed by Base UI Preview Card for upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on this page.
Hover or focus the link
WorkspaceHover the trigger with a pointer or move keyboard focus to it. Preview supplements a destination
link; activating the link still follows its native href. Use Popover when clicking the trigger
should open interactive content instead.
Import
Section titled “Import”import { Preview } from "@zentara-co/zenos-ui";Preview adds supplementary information to a destination link on hover or focus. The trigger remains a native anchor, so navigation works even when the preview never opens.
Preview.Trigger defaults to delay={0} and closeDelay={0} so the card and arrow follow the pointer and focus immediately. Increase delay when a short hover grace period helps avoid accidental previews; the popup and arrow still fade in and out together over 150ms.
Anatomy
Section titled “Anatomy”Content supplies the portal, collision-aware positioner, popup, and arrow. Group the title and description with Header for consistent spacing.
<Preview.Root> <Preview.Trigger href="/workspace">Workspace</Preview.Trigger> <Preview.Content> <Preview.Header> <Preview.Title>Design workspace</Preview.Title> <Preview.Description>Shared components and product foundations.</Preview.Description> </Preview.Header> </Preview.Content></Preview.Root>Rich preview
Section titled “Rich preview”Keep content concise and descriptive. Users should be able to decide whether to follow the destination without interacting with the preview itself.
Placement
Section titled “Placement”Content defaults below and centered on the trigger. Choose another side or alignment when surrounding layout requires it; collision avoidance can still flip the final placement.
Controlled state
Section titled “Controlled state”Use controlled state when another part of the surrounding interface needs to observe preview visibility. Hover and focus still request changes through onOpenChange.
Preview is closed.
Motion
Section titled “Motion”Previews fade, scale, and move from their resolved side when opening, then reverse that movement when closing. Reduced-motion preferences remove the animation automatically. The arrow fades with the surface.
Hover or focus each link. The first preview animates in and out. disableMotion makes the second appear and disappear immediately.
Custom styling
Section titled “Custom styling”Use the same semantic surface, border, and foreground family across className, arrowClassName, Title, and Description. Preview.Trigger accepts the Link component’s variant, underline, and size treatments.
Preview or another component
Section titled “Preview or another component”Use Preview to supplement a destination link with concise, non-essential information. Use Tooltip for a short label, Popover for interactive controls, and Dialog for modal or longer tasks.
Preview.Root Preview.Trigger Preview.Content Preview.Header Preview.Title Preview.Description Preview.Arrow
API
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | — | Controlled preview state. |
defaultOpen | boolean | false | Initial uncontrolled state. |
onOpenChange | (open: boolean, eventDetails) => void | — | Runs when hover or focus changes visibility. |
delay / closeDelay | number | 0 / 0 | Milliseconds before the preview opens or closes after hover or focus changes. Set on Preview.Trigger. |
side | top | right | bottom | left | bottom | Preferred placement. |
align | start | center | end | center | Trigger alignment. |
arrow | boolean | true | Renders the popup arrow with the same enter and exit motion as the surface. |
Content.disableMotion | boolean | false | Disables the popup and arrow enter and exit animation for this instance. |
sideOffset / alignOffset | number | sideOffset: 8 | Adjusts the popup distance and alignment-axis offset. |
Trigger.variant / Trigger.underline / Trigger.size | LinkVariant / LinkUnderline / sm | md | lg | default / hover / md | Applies the Link component's visual treatments to the native anchor trigger. |
Content.className / arrowClassName / positionerClassName | string | — | Customizes the popup, arrow, or positioning wrapper. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”Preview opens from both pointer hover and keyboard focus, and the trigger keeps native link behavior. Escape dismisses the preview. Treat its content as supplementary: essential labels, status, or instructions must remain available in the page itself. Use Popover when users need interactive controls, and provide meaningful destination text on every Preview.Trigger.