Skip to content

Tooltip

import { Tooltip } from '@yarcl/react';
<Tooltip content="Search" radius="md" padding="sm" textStyle="caption">
<IconButton aria-label="Search"><SearchIcon /></IconButton>
</Tooltip>
  • Opens after delay (400 ms) on hover, immediately on keyboard focus; closes on Esc.
  • Sets aria-describedby on the trigger.
  • radius, padding and textStyle use keys from your config and can be set in components.Tooltip.
  • Keep the content short and plain. Tooltips can’t contain interactive elements; use HoverCard or Popover for that.

When the tooltip repeats the trigger’s accessible name, set describe={false} to avoid announcing the same text twice. The visible tooltip still appears on hover and keyboard focus, while an explicit description on the trigger is preserved. The default describes the trigger with the tooltip text.

Spacing props accept typed breakpoint maps. See responsive props for supported props, defaults and examples.

PropTypeDefaultDescription
children requiredReactElementA single focusable element, e.g. an IconButton.
content requiredReactNodeShort text describing the trigger. Keep it plain; tooltips can't contain interactive content.
delaynumberconfig.timing.tooltipDelayDelay before opening on hover, in ms. Opens immediately on keyboard focus.
describebooleantrueAdds the tooltip as an accessible description. Disable when it repeats the trigger's name.
paddingResponsive<Spacing>configconfig.components.Tooltip.padding ?? config.defaults.paddingInner spacing, from the spacing config. Accepts a scalar or breakpoint map.
placementPlacement'top'Preferred side. Flips when there isn't room.
radiusRadiusconfigconfig.components.Tooltip.radius ?? config.defaults.radiusCorner radius, from the radii config.
refRef<Element>
textStyleTextStyleconfigconfig.components.Tooltip.textStyle ?? config.defaults.helperStyleTypography style, from the typography.styles config.