tooltip
A helpful description of an element when hovered or focused.
Import
Import just the tooltip styles.
@import "@winnie-ui/css/spatial/tooltip";@import "@winnie-ui/css/visual/tooltip";
Anatomy
Attach the appropriate data
attributes in the structure below.
<div data-component="tooltip"> <span data-slot="label"></span> <kbd data-slot="shortcut"></kbd></div>
Examples
Size
Use the data-size
attribute to change the size of the tooltip.
Radius
Use the data-radius
attribute to change the radius of the tooltip.
Shortcuts
Use the shortcut
slot as a child of the tooltip to show a keyboard shortcut.
Multiline
While long tooltips are supported by Winnie, we do not recommend them as a UI practice. Ideally, tooltips are short, descriptive text used to describe the intent of an action or subject.
Reference
Below is a list of the available tooltip data-
attributes that are available.