Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

HoverCard

Pass a React element as trigger and the preview as children. The machine manages delays, focus behavior, and placement.

import { HoverCard, Text } from '@manti-ui/react';

export default function HoverCardBasic() {
  return (
    <HoverCard
      trigger={
        <a
          href="https://en.wikipedia.org/wiki/Manti_(food)"
          target="_blank"
          rel="noreferrer"
        >
          @manti
        </a>
      }
    >
      <div className="grid gap-1">
        <strong>Mantı</strong>
        <Text as="span" emphasis="muted">
          Tiny Turkish dumplings served under garlicky yogurt and chili butter.
        </Text>
      </div>
    </HoverCard>
  );
}

API

PropTypeDefaultDescription
triggerReactElementElement that reveals the card on hover or focus. Cloned with the machine trigger props.
childrenReactNodeThe card content.
placement'top' | 'bottom' | 'left' | 'right' | '…-start' | '…-end''bottom'Placement of the card relative to the trigger.
showArrowbooleantrueRender the arrow pointing at the trigger.
openDelaynumberDelay before opening, in milliseconds.
closeDelaynumberDelay before closing, in milliseconds.
openbooleanControlled open state.
defaultOpenbooleanInitial open state for uncontrolled usage.
onOpenChange(open: boolean) => voidCalled whenever the open state changes.

Styling

Anatomy

PartSelectorDescription
positioner[data-scope="hover-card"][data-part="positioner"]Floating wrapper that positions the card against the trigger.
content[data-scope="hover-card"][data-part="content"]The translucent preview panel.
arrow[data-scope="hover-card"][data-part="arrow"]Arrow pointing back at the trigger.

Tokens

TokenControls
--manti-hover-card-max-widthmax width

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub