Skip to content
Alea0.1
Pro
  1. Alea
  2. Components
  3. Overlays
  4. Toggletip and InfoLabel

Overlays

Toggletip and InfoLabel

A small info button that opens a popover on press, with a title, text and links; three icons and two sizes. InfoLabel puts one next to a field label.

import { Toggletip, InfoLabel } from '@alea/ui';

Examples

Toggletip and InfoLabel

A small info button that opens a popover on press, with a title and links. InfoLabel puts one next to a field label.

Usage this month

Legacy export

Tokens

The design tokens this component reads, with their value in the current theme. Override any of them to restyle it.

Color

  • --alea-status-warning…
  • --alea-surface-hover…
  • --alea-text…
  • --alea-text-muted…

Type

  • --alea-font-size-sm…

Props

Toggletip props

A small info button that opens a popover on press: for explanations people may want to read, with links if needed. Escape or a press outside closes it.

PropTypeDefaultDescription
childrenrequiredReactNode-What the popover says. Can hold links and buttons (unlike a Tooltip).
aria-labelstring-The button's name for screen readers. Default "More information".
icon"warning" | "info" | "help"'info'The icon: info (default), help, or warning.
placement"start" | "end" | "bottom" | "top"'top'Where it opens. Default top.
size"sm" | "md"'sm'sm (16 px icon, default) or md (20 px).
titleReactNode-A title at the top of the popover.

InfoLabel props

A label with an info button beside it, for fields that need a longer explanation than help text.

PropTypeDefaultDescription
childrenrequiredReactNode-The label text.
inforequiredReactNode-What the info button explains.
aria-labelstring-The button's name for screen readers. Default "More information".
classNamestring-Extra class names.
htmlForstring-The id of the field this labels, to use it as a field label.
icon"warning" | "info" | "help"-The icon: info (default), help, or warning.
isRequiredboolean-Marks the field as required.
placement"start" | "end" | "bottom" | "top"-Where it opens. Default top.
size"sm" | "md"-sm (16 px icon, default) or md (20 px).
titleReactNode-A title at the top of the popover.

Specs

Generated from the source: the variants in the types, the states and tokens in the CSS, and the motion patterns that apply. The grids render the real component in both themes; the numbers are measured from the page.

Toggletip

Variants
iconwarninginfohelp
placementstartendbottomtop
sizesmmd
States
HoverPressed
Dark and light
Every color comes from theme tokens, so it follows data-theme (and presets like Graphite) on the page or any wrapper. Contrast is checked in both themes.
Styling hooks
.alea-toggletip-btn.alea-toggletip
Data attributes
data-size=mddata-icon=warning

InfoLabel

Variants
iconwarninginfohelp
placementstartendbottomtop
sizesmmd
Dark and light
Every color comes from theme tokens, so it follows data-theme (and presets like Graphite) on the page or any wrapper. Contrast is checked in both themes.
Styling hooks
.alea-info-label.alea-label-required

Accessibility

  • A real button named "More information" (or your label) that opens a dialog popover; Escape closes and focus returns to the button.
  • Unlike a tooltip, it opens on press and can hold links, so it works on touch screens and with screen readers.

Keyboard

KeyDoes
Enter or SpaceOpens it
EscapeCloses it
TabMoves into its links

Do and don't

Do

  • Use it for explanations people may want, not for anything they need to finish the task.

Don't

  • Don't hide errors or required steps in a toggletip.
Tested with axe, keyboard and screen reader roles