Hint
A question mark after a label that explains one setting on demand, so a page at rest shows names and controls.
import { Hint } from "@arcadia/ui"Software update
A question mark after a label, for the setting its name cannot explain. A page at rest shows names and controls; the sentence waits in a tooltip until someone asks for it. A setting whose name says what it does takes no hint at all, and most do.
The text is one or two sentences, at most 160 characters, and plain: no links, no controls. SettingsRow, SettingsGroup, Field and Switch take it as hint, and a SegmentedControl item takes one per choice, so the hint is rarely placed by hand. Something a person must read to act safely is not a hint: it is a SettingsNotice, shown on the page.
Examples
Open
Rendered pinned in place. Beside a label the glyph takes the label's letter height and its stem; the button around it is 24px and does not change the line's height.
Beside any label
The glyph sits on its label's line as a letter would: its middle is the middle of the label's capitals, at the label's size and stem.
The hint is a button named About and its label, described by its text, so a screen reader hears the sentence on the button without opening anything. In the tab order it follows its label and comes before the row's control. Field and Switch also give the text to their control as its description. It opens when the pointer rests on it and at once on keyboard focus; a press pins it, so touch and keyboard users can read it without holding anything.
- Enter or Space
- Pins the hint open, or closes it
- Esc
- Closes the hint and nothing under it
- Tab
- Moves on to the control; the hint closes
Hint
labelrequired- string
- What it explains: the button's accessible name is
About ${label}. textrequired- string
- One or two sentences, at most 160 characters. Plain text: no links, no controls, no markup.
side- "top" | "bottom" | "left" | "right" | "inline-start" | "inline-end"Default "top"
defaultOpen- booleanDefault false
- Starts pinned open (a specimen, a first-run pointer).
tabbable- booleanDefault true
falsekeeps it out of the Tab order where its text already describes the control (a form field), so Tab goes field to field; the pointer still opens it.rootStyle- RootStyle
- Typed StyleX override: where the hint sits.