Skip to main content

TooltipProps

note

This type is deducted from Spotify's internal usage. It may not be accurate and may change in the future.

The TooltipProps object is used to create a tooltip.

type TooltipProps = {
label: string;
children: React.ReactNode;
renderInline?: boolean;
showDelay?: number;
disabled?: boolean;
placement?: 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
labelClassName?: string;
};

Properties

PropertyTypeDescription
labelstringLabel to display in the tooltip
childrenReact.ReactNodeThe child element that the tooltip will be attached to and will display when hovered over
renderInlinebooleanDecide whether to use the global singleton tooltip (rendered in <body>) or a new inline tooltip (rendered in a sibling element to children)
showDelaynumberDelay in milliseconds before the tooltip is displayed after the user hovers over the child element
disabledbooleanDetermine whether the tooltip should be displayed
placement'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end'The preferred placement of the context menu when it opens. Relative to trigger element.
labelClassNamestringClass name to apply to the tooltip