import * as React from 'react'; import { TooltipHost, ITooltipHostStyles } from '@fluentui/react/lib/Tooltip'; import { getTheme } from '@fluentui/react/lib/Styling'; import { useId } from '@fluentui/react-hooks'; const theme = getTheme(); const buttonStyle = { fontSize: theme.fonts.medium.fontSize, padding: 10 }; const calloutProps = { gapSpace: 0 }; // Important for correct positioning--see below const inlineBlockStyle: Partial = { root: { display: 'inline-block' }, }; export const TooltipDisplayExample: React.FunctionComponent = () => { // Use useId() to ensure that the ID is unique on the page. // (It's also okay to use a plain string and manually ensure uniqueness.) const tooltip1Id = useId('tooltip1'); const tooltip2Id = useId('tooltip2'); return (
In some cases when a TooltipHost is wrapping inline-block or inline elements, the positioning of the Tooltip may be off. In these cases, it's recommended to set the TooltipHost's{' '} display property to inline-block, as in the following example.

{' '}
); };