Tooltip

Organism

Short hint shown on hover and focus. Accessible via role="tooltip" + aria-describedby. Supports 4 placements, 3 themes, optional arrow, and configurable delay.

Placements

Preview
Top tooltip Bottom tooltip Right tooltip
Code
<%- include('modules/ui/Tooltip', { content: 'Top tooltip', placement: 'top', children: '<button>Top</button>' }) %>
<%- include('modules/ui/Tooltip', { content: 'Bottom tooltip', placement: 'bottom', children: '<button>Bottom</button>' }) %>
<%- include('modules/ui/Tooltip', { content: 'Right tooltip', placement: 'right', children: '<button>Right</button>' }) %>

Themes

Preview
Default theme Dark theme Light theme
Code
<%- include('modules/ui/Tooltip', { content: 'Default theme', theme: 'default', children: '<button>Default</button>' }) %>
<%- include('modules/ui/Tooltip', { content: 'Dark theme', theme: 'dark', children: '<button>Dark</button>' }) %>
<%- include('modules/ui/Tooltip', { content: 'Light theme', theme: 'light', children: '<button>Light</button>' }) %>

With arrow

Preview
Has an arrow Has an arrow
Code
<%- include('modules/ui/Tooltip', {
  content: 'Has an arrow',
  placement: 'top',
  arrow: true,
  children: '<button>Top + arrow</button>'
}) %>

On an icon button

Preview
Open settings
Code
<%- include('modules/ui/Tooltip', {
  content: 'Open settings',
  placement: 'top',
  theme: 'dark',
  children: '<button aria-label="Settings"><i class="fa-solid fa-gear"></i></button>'
}) %>
Source modules/ui/Tooltip.ejs