@carbon/react 1.11.0 // ToolTip component not working #12005
-
Hi Carbon Team! I'm trying to add a simple ToolTip to my application but unfortunately I cannot get it working. Furthermore the documentation is outdated. According to the docs it should work like <Tooltip align="bottom" label={label}>
<button className="sb-tooltip-trigger" type="button">
<Information />
</button>
</Tooltip> But according to the source code it should be used the following way: <Tooltip triggerText="Test Tooltip" direction="right">
<p>This is some tooltip text.</p>
</Tooltip> I've created a very simple codesandbox to demonstrate it: https://codesandbox.io/s/carbon-react-tooltip-s3lvno?file=/src/index.js Am I using the component in a wrong way or is there a bug in the component? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey there @urbanisierung! Sorry for the inconvenience caused. The bottom source code may be coming from the t The Here's a link to an updated CodeSandbox that hopefully helps illustrate the usage a little clearer: Code example. Also of note, there is a Let me know if that helps and if you have any more questions! |
Beta Was this translation helpful? Give feedback.
Hey there @urbanisierung! Sorry for the inconvenience caused. The bottom source code may be coming from the
v10
version; withv11
and the switch to@carbon/react
, the documentation shows the correct usage. Here is a link to the v11 source, which now utilizes thePopover
component.t The
Tooltip
wraps an interactive element, in this case, abutton
. In our storybook, we've styled the button a little bit, which could be causing some confusion.Here's a link to an updated CodeSandbox that hopefully helps illustrate the usage a little clearer: Code example.
Also of note, there is a
ToggleTip
component, which can be used when the tooltip content has interactive elements inside.Let me know if t…