@antadesign/anta
    Preparing search index...

    Interface TooltipPropsUnreviewed

    Common props for JSX component wrappers.

    interface TooltipProps {
        children?: ReactNode;
        delay?: number;
        placement?: "top" | "bottom" | "left";
        round?: boolean | number | string;
        follow?: boolean;
        interactive?: boolean;
        truncatedOnly?: boolean;
        truncatedSelector?: string;
        className?: string;
        style?: CSSProperties;
        id?: string;
        title?: string;
        slot?: string;
        tabIndex?: number;
        key?: string | number | null;
        [key: `data-${string}`]: unknown;
        [key: `aria-${string}`]: unknown;
    }

    Hierarchy (View Summary)

    Indexable

    • [key: `data-${string}`]: unknown

      Any data-* attribute is forwarded to the rendered element.

    • [key: `aria-${string}`]: unknown

      Any aria-* attribute is forwarded to the rendered element.

    Index
    children?: ReactNode

    Tooltip content. Renders anything — text, markup, an icon + text. Lives in the light DOM, so it's styleable with your own plain CSS.

    delay?: number

    Show delay in milliseconds after hover / focus. Never use 0 — use ~50 for a near-instant tooltip (0 has caused issues in practice).

    300
    
    placement?: "top" | "bottom" | "left"

    Which side of the anchor the bubble prefers. Auto-flips to the other side when there isn't room.

    bottom
    
    round?: boolean | number | string

    Round the bubble to a 20px radius (matching a round menu). Pass a number (px) or a CSS length string for a custom radius.

    follow?: boolean

    Follow the cursor instead of pinning under the anchor. The bubble is pinned (anchored beneath the target) by default; pass follow for the cursor-tracking behavior, which fades by distance as the cursor leaves.

    interactive?: boolean

    Make the bubble hoverable and clickable — enables pointer events and keeps it open while the cursor is over it, so its content (links, buttons) can be interacted with. Always pinned (an interactive bubble can't follow the cursor, even with follow).

    truncatedOnly?: boolean

    Only show when the target is actually truncated (its text overflows and is ellipsized); a label that fits gets no tooltip. The check is a UI-thread layout read, re-measured on each show. By default it measures every Anta ellipsizing label part inside the anchor, then the anchor itself — override with truncatedSelector.

    truncatedSelector?: string

    CSS selector (resolved within the anchor) for the element or elements whose overflow decides whether a truncatedOnly tooltip shows.

    className?: string

    CSS class on the component's root element (merged with the component's own classes). Use it directly for layout and positioning — grid/flex placement, margins, alignment — rather than wrapping the component in a <div>/<span>.

    style?: CSSProperties

    Inline styles on the component's root element. Set layout/positioning here (or via className) directly on the component instead of adding a wrapper.

    id?: string

    HTML id attribute.

    title?: string

    HTML title attribute — native browser tooltip on hover.

    slot?: string

    Assigns the element to a named <slot> of a parent web component (e.g. slot="header" inside a <Card>, slot="footer" inside a <Dialog>).

    tabIndex?: number

    Tab order. Set to -1 to skip the element when tabbing.

    key?: string | number | null

    React/Preact reconciliation key when rendered inside a list. Consumed by the JSX runtime (not forwarded as a DOM attribute).