
Give a terse control an accessible name and a hover/focus tooltip
Source:R/ui-fields.R
a11yControl.RdIcon-only or single-word controls (the dark-mode toggle, plot/table
download buttons, help-modal triggers) carry little visible text, so they
are hard to identify by mouse, keyboard or screen reader. This sets an
aria-label for assistive technology and wraps the control in a short
bslib::tooltip() that surfaces on both hover and keyboard focus.
Arguments
- tag
A single UI element to annotate
- label
Accessible name, applied as the tag's
aria-label- tooltip
Tooltip text shown on hover/focus; defaults to
label- placement
Tooltip placement, passed to
tooltip
Value
tag wrapped in a bslib::tooltip()