Skip to content
UI Brok

Loading…

No results

Browse catalog

Tooltip

Hover- and focus-triggered hint linked to its trigger via aria-describedby.

Preview

Add to library This appears below

Controls

Theme
Surface
Direction
Viewport

Device view renders in an isolated frame so real responsive breakpoints apply. Switch to Full for overflowing popovers.

Installation

terminal
php artisan ui:add tooltip

Behavior layer (Alpine)

This component installs a self-registering Alpine module to resources/js/ui/tooltip.js. Import the behavior layer once from your bundle so it loads (it hooks alpine:init):

resources/js/ui/index.js JS
import './tooltip.js';

Registry contract

Install confidence

php artisan ui:add tooltip writes only the generated targets below. The CLI validates each file hash before writing and prompts before replacing local changes unless --force is used.

Version
1.1.2
License
open
Stability
stable
Contract
v2
Foundation
≥ 1.0.0
Type Generated target
blade resources/views/components/ui/tooltip.blade.php
js resources/js/ui/tooltip.js

Registry dependencies

None.

Package dependencies

composer: jml/brok:^1.0

npm: alpinejs

Guidance

Supplementary clarification

Clarify an already understandable control.

Use when

  • Use for brief nonessential clarification of an existing control. Do not put critical instructions, errors, or primary actions in a tooltip.

Avoid when

  • Keep content terse and supplementary. Critical guidance must remain visible without hover or focus.
Task length
micro
Interaction cost
medium
Interruptiveness
low
Input precision
none
Mobile / touch risk
high
Accessibility risk
high
Needs background context
Yes
Comparison needed
No

Preferred alternatives

  • Visible label or help text

Anti-patterns

  • Critical instructions or errors in tooltips
  • Hover-only essential content

API

manifest knowledge + registry-derived coverage

Props

Prop Type / values Default Description
content string '' Tooltip text.
text string Declared by @props in the registry Blade source.
side string top Declared by @props in the registry Blade source.
arrow bool false Declared by @props in the registry Blade source.
delay int 150 Declared by @props in the registry Blade source.
sideOffset int 6 Declared by @props in the registry Blade source.

Slots

  • default — Trigger content.

Data slots

tooltip tooltip-arrow tooltip-content tooltip-trigger

Capabilities

wcag-2.2-aa-target interactive responsive rtl darkMode localized

Behavior

  • Uses server-rendered Blade and semantic HTML.
  • Shows contextual help on hover/focus and hides on blur or pointer leave.
  • Installs a JavaScript behavior module when the registry item includes resources/js/ui files.
  • Declares registry capability flags: a11y, interactive, responsive, rtl, darkMode, localized.

Usage

previews.components.tooltip.default.blade.php Blade
<div class="flex items-center gap-6">
    <x-ui.tooltip :text="__('Add to library')">
        <x-ui.button variant="outline">{{ __('Hover or focus me') }}</x-ui.button>
    </x-ui.tooltip>

    <x-ui.tooltip :text="__('This appears below')" side="bottom">
        <x-ui.button variant="ghost">{{ __('Bottom') }}</x-ui.button>
    </x-ui.tooltip>
</div>

Accessibility & localization

WCAG 2.2 AA RTL-ready data-slot Keyboard focus-visible Localized labels
  • Accessibility target: wcag-2.2-aa-target.
  • Uses semantic HTML and a stable data-slot attribute for styling/scripting hooks.
  • Focus-visible rings use the ring token so keyboard focus is always visible.
  • Disabled and invalid states are conveyed to assistive tech, not by color alone.
  • Targets WCAG 2.2 AA; verify contrast in light, dark, admin and customer surfaces above.
  • Labels go through __() and the component uses logical properties (ms-*, text-start, start-*) so it mirrors correctly — flip the preview to RTL to confirm.

Source

The exact, editable file ui:add writes into your app — copy it or own the whole thing. Previews render this same code; there are no preview-only components.

Changelog

Current version: v1.1.2. See the site changelog for the full release history.