packages/grafana-ui/src/components/Tooltip/Tooltip.mdx
import { ArgTypes } from '@storybook/addon-docs/blocks'; import { Tooltip } from './Tooltip';
Tooltips display additional information upon hover or focus. The information included should be contextual, helpful, and non-critical to the user's task-at-hand. The information should be concise and provide clarity to the user.
There are currently themes available for the Tooltip.
This is the default theme, usually used in forms to show more information.
Tooltip with a red background.
We added this to be able to add a <JSONFormatter /> in the tooltip.
| Variants | Purpose |
|---|---|
| Info (aka default) | Provides contextual supportive information to the user |
| Info-alt | Not sure on what this is |
| Error | Acts as inline validation |
aria-labelledby if the tooltip acts as a primary label (i.e., to name an IconButton action).aria-describedby if the tooltip acts as a supporting label (i.e., to provide additional information on an input).Tooltips are triggered when the mouse hovers over or focuses on the UI trigger. The tooltip persists as long as the mouse remains over the active container or the UI trigger, or there is focus on the active container or UI trigger. The tooltip is dismissed by hovering away or moving focus to another element.
If interactive elements are needed, consider using a Toggletip.