import { WithTooltip } from '.' # WithTooltip Returns a higher order component (HOC) that renders a tooltip. Make sure to pass an existing element container ID and spread props of the wrapped component. The `WithTooltip` function takes a component to be wrapped, and an optional container ID used to insert the tooltip into. If no container ID is passed, it will fallback to `Tooltip__container`. If no portal is found, it will log a warning. The wrapped component takes a `tooltipPosition` prop for placing the tooltip, and a label prop for the tooltip text. ```javascript type `tooltipPosition` = 'top' | 'bottom' | 'right' | 'left'; ``` **Please note** - This HOC will eventually be deprecated, as we plan to create a `` component in its place. We do not recommend using this HOC. ## Importing ```javascript import { WithTooltip } from 'amazon-chime-sdk-component-library-react'; ``` ## Example ```jsx const MyComponent = (props) => { return
hello world
; } const WrappedComponent = WithTooltip(MyComponent, "a-tooltip-container"); // usage const App = () => ( <>
) // Alternate usage const App = () => ( <> Hello world
} tooltipPosition="bottom" />
) ```