Tooltip
A popup that appears when an element is hovered or focused, showing a hint for sighted users.
Usage guidelines
- Prefer using tooltips as visual labels only: Tooltips are supplementary visual labels for sighted mouse and keyboard users. On their own they aren't accessible to touch or screen reader users.
- Provide an accessible name for the trigger: A tooltip doesn't label its trigger. Give the trigger an
aria-labelthat closely matches the tooltip's content, so screen reader users get the same information.
Anatomy
Import the primitives and assemble the parts:
@using Blazix.Primitives
<TooltipProvider>
<TooltipRoot>
<TooltipTrigger />
<TooltipPortal>
<TooltipPositioner>
<TooltipPopup>
<TooltipArrow />
<TooltipViewport />
</TooltipPopup>
</TooltipPositioner>
</TooltipPortal>
</TooltipRoot>
</TooltipProvider>API Reference
TooltipRoot
Doesn't render its own HTML element.
TooltipProvider
Doesn't render its own HTML element.
TooltipTrigger
Renders a <button> element.
Other attributes are passed to the element it renders.
TooltipPortal
Doesn't render its own HTML element.
TooltipPositioner
Doesn't render its own HTML element.
TooltipPopup
Renders a <div> element.
Other attributes are passed to the element it renders.
TooltipArrow
Renders a <div> element.
Other attributes are passed to the element it renders.
TooltipViewport
Renders a <div> element.
Other attributes are passed to the element it renders.