Used when the content of the tooltip is the "primary label" for its content, for example, when the trigger content is an icon. The tooltip content will supercede the content of the trigger HTML for screen readers.
This is the default.
Known issues:
Post-release patches:
Changes from V1:
customTriggerAttributesopen attributeThese tooltips follow the accessibility recommendations from: https://inclusive-components.design/tooltips-toggletips
Example usage:
Tooltip.view
{ trigger =
\attrs ->
ClickableText.button "Click me to open the tooltip"
[ ClickableText.custom attrs ]
, id = "my-tooltip"
}
[ Tooltip.plaintext "Gradebook"
, Tooltip.primaryLabel
, Tooltip.onClick MyOnTriggerMsg
, Tooltip.open True
]Supplementary information triggered by a "?" icon.
Put the arrow at the "start" of the tooltip. For onTop & onBottom tooltips, this means "left". For onLeft & onRight tooltip, this means "top".
__________
|_ ______|
\/Put the arrow at the "middle" of the tooltip. This is the default behavior.
__________
|___ ____|
\/Put the arrow at the "end" of the tooltip. For onTop & onBottom tooltips, this means "right". For onLeft & onRight tooltip, this means "bottom".
__________
|______ _|
\/Define a size in px for the tooltips's total width. The default is 320px.
Tooltip width fits its content.
This the default spacing.
Pass in the desired spacing around the edge of the tooltip (pixels).
The tooltip opens when clicking the root element, and closes when anything but the tooltip is clicked again.
The tooltip opens when hovering over the trigger element, and closes when the hover stops.
Set some custom styles on the tooltip. These will be treated as overrides, so be careful!
Use this helper to add custom attributes.
Do NOT use this helper to add css styles, as they may not be applied the way
you want/expect if underlying styles change.
Instead, please use the css helper.
DEPRECATED -- a future release will remove this helper.
Used when the content of the tooltip is the "primary label" for its content, for example, when the trigger content is an icon. The tooltip content will supercede the content of the trigger HTML for screen readers.
This is the default.
Used when the content of the tooltip provides an "auxillary description" for its content.
Here's what the fields in the configuration record do:
trigger: What element do you interact with to open the tooltip?id: A unique identifier used to associate the trigger with its content