Tooltip

A lightweight accessible tooltip that appears on hover or focus.

Import

import { Tooltip } from '@adjanour/react-components'
import '@adjanour/react-components/tooltip.css'

Live Example

Hover or focus each button to see the tooltip:

Usage

<Tooltip content="Helpful hint" position="top">
  <button>Hover me</button>
</Tooltip>

Props

PropTypeDefaultDescription
contentReactNodeRequiredTooltip content
childrenReactNodeRequiredTrigger element
position'top' | 'bottom' | 'left' | 'right''top'Tooltip position

Behavior

Theming

VariableDefaultDescription
--aw-tooltip-bg#0f172aBackground
--aw-tooltip-text#fffText color
--aw-tooltip-radius6pxBorder radius
--aw-tooltip-arrow6pxArrow size