Tooltip
User-triggered messages that provide a brief description of a component's function
Demo
Tooltip information
You can add HTML children to the tooltip content slot.
Do not include interactive elements as tooltip content. These include:
- Buttons
- Links
- Input fields
API
Tag
| Name | Description |
<s-tooltip>
|
Custom tag, accepts a slot as content |
Attributes
| Name | Value | Required | Description |
tooltipid |
String |
|
Unique ID for the tooltip element. |
triggerid |
String |
|
ID of the tooltip trigger. |
placement |
String |
Position of the tooltip relative to the trigger. Defaults to
|
|
hidearrow |
Boolean |
Hides the tooltip arrow. Defaults to |
Properties
| Name | Value | Required | Description |
tooltipId |
String |
|
Unique ID for the tooltip element. |
triggerId |
String |
|
ID of the tooltip trigger. |
placement |
String |
Position of the tooltip relative to the trigger. Defaults to
|
|
hideArrow |
Boolean |
Hides the tooltip arrow. Defaults to |
Slots
| Name | Required | Description |
|---|---|---|
content
|
|
Demo
API
Tag
| Name |
<STooltip>
|
Slots
| Name | Required | Description |
|---|---|---|
content
|
|
Props
| Name | Value | Required | Description |
tooltipId |
String |
Unique ID for the tooltip element. |
|
triggerId |
String |
ID of the tooltip trigger. |
|
placement |
String |
Position of the tooltip relative to the trigger. Defaults to
|
|
hideArrow |
Boolean |
Hides the tooltip arrow. Defaults to |
Skylab React links
Guidelines
Accessibility
Assign the tooltip ID to the tooltip trigger's aria-describedby attribute. This ensures that screen readers will associate the trigger with the tooltip text.
Do not include interactive elements, such as inputs, buttons, or links, as tooltip content. Browser focus does not transfer to the tooltip content when it is open.
Only use focusable elements as tooltip triggers. Keyboard-only users will not be able to access tooltip content if the trigger is not focusable.
Usage
A tooltip must be used to describe the function of an icon-only button, in addition to an aria-label on the button.
Design
Design resources can be found on the Skylab design documentation site: skylab.avalara.com