API reference: @salmonui/overlays/tooltip
TooltipPropsinterface
import type { TooltipProps } from '@salmonui/overlays/tooltip';interface TooltipProps {
readonly content: ReactNode;
readonly children?: ReactNode;
readonly render?: ((props: TooltipTriggerProps) => ReactElement) | undefined;
readonly open?: boolean | undefined;
readonly defaultOpen?: boolean | undefined;
readonly onOpenChange?: ((open: boolean, event: TooltipOpenChangeEvent) => void) | undefined;
readonly onAfterOpen?: (() => void) | undefined;
readonly onAfterClose?: (() => void) | undefined;
readonly placement?: TooltipPlacement | undefined;
readonly offset?: TooltipOffset | undefined;
readonly arrow?: boolean | undefined;
readonly collisionBoundary?: Element | null | undefined;
readonly container?: Element | null | undefined;
readonly delay?: number | undefined;
readonly closeDelay?: number | undefined;
readonly followCursor?: boolean | undefined;
readonly disabled?: boolean | undefined;
readonly contentProps?: TooltipContentProps | undefined;
readonly className?: string | undefined;
readonly style?: CSSProperties | undefined;
readonly classNames?: Partial<Record<TooltipPart, string>> | undefined;
readonly styles?: Partial<Record<TooltipPart, CSSProperties>> | undefined;
readonly ref?: Ref<HTMLDivElement> | undefined;
}
| Name | Signature | Description |
|---|---|---|
content | readonly content: ReactNode; | Tooltip text or nodes (no interactive content: use |
childrenoptional | readonly children?: ReactNode; | The trigger, wrapped in a |
renderoptional | readonly render?: ((props: TooltipTriggerProps) => ReactElement) | undefined; | Renders the trigger element itself with the computed props (no wrapper span). Wins over |
openoptional | readonly open?: boolean | undefined; | |
defaultOpenoptional | readonly defaultOpen?: boolean | undefined; | |
onOpenChangeoptional | readonly onOpenChange?: ((open: boolean, event: TooltipOpenChangeEvent) => void) | undefined; | |
onAfterOpenoptional | readonly onAfterOpen?: (() => void) | undefined; | After the content is shown / removed. |
onAfterCloseoptional | readonly onAfterClose?: (() => void) | undefined; | |
placementoptional | readonly placement?: TooltipPlacement | undefined; | Logical placement resolved against |
offsetoptional | readonly offset?: TooltipOffset | undefined; | Gap to the anchor in px (default 6) or |
arrowoptional | readonly arrow?: boolean | undefined; | Arrow pointing at the anchor. Default true. |
collisionBoundaryoptional | readonly collisionBoundary?: Element | null | undefined; | Element whose box limits flip and shift. Default the viewport. |
containeroptional | readonly container?: Element | null | undefined; | Portal target (the tooltip is in the top layer where the Popover API exists). Default |
delayoptional | readonly delay?: number | undefined; | Open delay in ms (default from |
closeDelayoptional | readonly closeDelay?: number | undefined; | Close delay in ms (default from |
followCursoroptional | readonly followCursor?: boolean | undefined; | Follows the pointer over the trigger (CSS translate written per frame, never React state). |
disabledoptional | readonly disabled?: boolean | undefined; | Never opens. |
contentPropsoptional | readonly contentProps?: TooltipContentProps | undefined; | Extra attributes for the content element, |
classNameoptional | readonly className?: string | undefined; | |
styleoptional | readonly style?: CSSProperties | undefined; | |
classNamesoptional | readonly classNames?: Partial<Record<TooltipPart, string>> | undefined; | |
stylesoptional | readonly styles?: Partial<Record<TooltipPart, CSSProperties>> | undefined; | |
refoptional | readonly ref?: Ref<HTMLDivElement> | undefined; | The content element ( |