GitHubGitHub
← All components
Overlays / component

Tooltip

A concise hover and focus explanation positioned above or below its trigger.

TopBottomKeyboard focus
Latest validated metrics value
<Tooltip content="Last synced 2 minutes ago">...</Tooltip>

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { Tooltip } from '@chanrg/4ui';<Tooltip content="Last synced 2 minutes ago">...</Tooltip>

API reference

Props

PropTypeDefaultDescription
contentstringrequiredTooltip text.
placementtop | bottomtopPreferred side.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Appears for pointer hover and keyboard focus.

Dependencies

No runtime component dependencies.