Meridianby Commenda
Components

Popover

A small card anchored to its trigger.

A small card anchored to its trigger: read-only context, a quick task, or a preview of an entity or record on hover. It never blocks the page and closes as soon as people move on. Popover is a product element: on the website it appears in product shots and animations, like a hover card over an entity.

Usage

Example.tsx
import { Popover } from "@commenda/meridian/ui/popover";

<Popover
  mode="preview"
  trigger={<Button variant="link">Acme GmbH</Button>}
  title="Acme GmbH"
  description="Subsidiary"
>
  …key facts…
</Popover>;

Form

A header with close and a footer with sm Cancel and primary, for a quick task that fits in one card. One width, 320. Opens on click.

Preview

A read-only card on hover or focus, for something people want to check without leaving the page. Header, a hairline, key facts and at most one link. While it fetches it shows skeleton bars (loading). Hover or focus each trigger below; the last one starts loading.

entity
record
loading

Kinds

Four previews cover every hover card: entity, record, file and person. Pick by what is being previewed, not by where it appears.

Anatomy

Width 320, 16 padding, Elevation/menu. Preview: header with a 24 leading (flag or icon; a person’s avatar is 32), title Label/13 Strong and meta, a 0.5 hairline, then label and value rows 8 apart, and at most one link. Anchored 4 from the trigger.

API reference

PropTypeDescription
triggerRequiredReactElement<unknown, string | JSXElementConstructor<any>>From Pathfinder.
titleRequiredstringFrom Pathfinder.
childrenRequiredReactNodeFrom Pathfinder.
openConditionalbooleanFrom Pathfinder.
onOpenChangeConditional(open: boolean) => voidFrom Pathfinder.
defaultOpenbooleanFrom Pathfinder.
descriptionReactNodeFrom Pathfinder.
positionConfigObjectView fieldsFrom Pathfinder.
classNamestringFrom Pathfinder.
modeConditional"form" | "preview"From Pathfinder.
closeConfigObjectView fieldsFrom Pathfinder.
footerConfigOverlayFooterConfigView fieldsFrom Pathfinder.
focusConfigOverlayFocusConfigView fieldsFrom Pathfinder.
loadingConfigObjectView fieldsFrom Pathfinder.
positionConfigObject fields
FieldTypeDescription
side"top" | "bottom" | "right" | "left"
align"center" | "start" | "end"
closeConfigObject fields
FieldTypeDescription
visibleboolean
labelstring
footerConfigObject fields
FieldTypeDescription
primaryActionOverlayAction
secondaryActionOverlayAction
leadingContentReactNode
cancelLabelstring
focusConfigObject fields
FieldTypeDescription
initialFocusRefRefObject<HTMLElement | null>
returnFocusRefRefObject<HTMLElement | null>
loadingConfigObject fields
FieldTypeDescription
isLoadingRequiredboolean
labelstring

Best practices

  • Use a Popover for secondary content or a quick task. A list of actions is a Dropdown; a hint on hover is a Tooltip; a task that needs focus is a Dialog.
  • Form opens on click. Only preview opens on hover (or focus), after 150 ms, and it stays read-only: never a form, at most one link.
  • Anchor 4 from the trigger and align to its start or end edge. Grow from the trigger corner, never from the center.
  • In an animation it grows from 0.97 to 1 over 150 ms, ease-out, and closes in 100 ms. No backdrop.
  • Keep a form popover to one or two fields. More than that is a Sheet or a Dialog.
  • One popover at a time. Opening another closes the first.
  • Source: Pathfinder Popover. Meridian keeps it as is; the two prototypes are not carried over.

On this page