Base JS behaviour

Tooltip

A short note for one focusable element; entry delay and four-side placement.

Real scenarios

The component as it is used in a product — not a specimen grid.

Icon-only actions on the invoice row

Hover a button and after the default 350 ms the tip settles below the row, clear of the row above; Tab brings it up at once and Escape closes it. The tip describes (aria-describedby) while the name still comes from aria-label — an icon-only button keeps both.

Invoice 1,042 Paid

Fee terms and a clipped name in the checkout summary

The default side lands the tip above its trigger, away from the amounts underneath. The info button answers “what is this fee?”, and the buyer’s pill — clipped by the narrow column — reads in full through its own tip; it is focusable with tabindex, so the keyboard sees it too.

  • Payment gateway fee 18,400 Toman
  • Value-added tax 1,656 Toman
  • Buyer Amara Okafor — order #981, Esfand 1403

The locked delete says why

A truly disabled button never sees the pointer, so its reason stays hidden. The sound pattern is a live button carrying aria-disabled: the tip settles on its inline-end side with a shorter 150 ms delay, and the click answers with a warning toast instead of pretending nothing happened.

Delete the workspace One unsettled payout is still open.

Important props

Important props
Prop Type Default What it does
text string — The tooltip text (role=tooltip).
side string top Placement: top · bottom · start · end.
delay int 350 Entry delay in milliseconds.

Snippet

<x-nx::tooltip text="کپی لینک دعوت">
    <x-nx::button icon="copy" icon-only aria-label="کپی لینک دعوت" />
</x-nx::tooltip>