Skip to content

Adapted from the canonical English UIX documentation by Lint-Free-Technology/uix, CC BY 4.0. Source: dev / 9.0.0-beta.2, revision 26e54e6, reviewed 22 October 2026. This source mirror may describe preview behavior beyond stable 8.4.0. Markup adapted for this site; the original documentation remains authoritative.

Tooltip spark ​

The tooltip spark attaches a styled tooltip to any element inside a UIX Forge forged element. It uses Home Assistant's wa-tooltip component (the same component used throughout the HA frontend), so it integrates with the HA design system, supports 12 placement positions and floats above all other UI layers via the browser's Popover API.

Basic usage ​

Add a tooltip entry to forge.sparks:

yaml
type: custom:uix-forge
forge:
  mold: card
  sparks:
    - type: tooltip
      for: hui-tile-card
      content: Turn on the lights
element:
  type: tile
  entity: light.kitchen_lights

Basic tooltip spark

The for value is a selector that locates the target element within the forged element. It supports the same DOM navigation syntax as UIX styles, including $ to cross shadow-root boundaries.

yaml
type: custom:uix-forge
forge:
  mold: card
  sparks:
    - type: tooltip
      for: hui-tile-card $ ha-tile-icon
      content: Toggle the living room light
element:
  type: tile
  entity: light.kitchen_lights

Tooltip spark for tile icon

Only the first element matched by for gets the tooltip.

Configuration ​

KeyTypeRequiredDefaultDescription
typestring✅—Must be tooltip.
forstringelementUIX selector for the target element. When the UIX Forge element is using Blank card config, the default is uix-forge-blank-card $ div.content. Otherwise, the default of element refers to the root of the forged element.
contentstring""HTML content of the tooltip body.
placementstring"top"Tooltip position relative to the target. Placement values are top, top-start, top-end, bottom, bottom-start, bottom-end, left, left-start, left-end, right · right-start, right-end.
distancenumber8Gap in pixels between the tooltip and the target element.
skiddingnumber0Offset in pixels along the target element's axis.
show_delaynumber150Milliseconds to wait before showing the tooltip.
hide_delaynumber150Milliseconds to wait before hiding the tooltip.
triggerstring"hover focus"Space-separated activation modes: hover, focus, click, or manual.
openbooleanfalseSet the tooltip's open state when the spark configuration changes. This is particularly useful with trigger: manual.
without_arrowbooleanfalseSet to true to hide the directional arrow.

TIP

You can use the uix_forge_path() DOM helper to take the guesswork out of finding the right path for for.

When hover is enabled, the tooltip remains open while the pointer moves from the target into the tooltip body. This allows content constrained with --uix-tooltip-max-height and --uix-tooltip-overflow: auto to be scrolled. manual does not activate automatically; set open: true to open it from the spark configuration.

yaml
forge:
  sparks:
    - type: tooltip
      trigger: manual
      open: true
      content: This tooltip is opened by the spark configuration

Templates in content ​

The content value is part of the forge config and is therefore processed as a template, giving you access to entity states, the config object and any other UIX template variables:

yaml
type: custom:uix-forge
forge:
  mold: card
  sparks:
    - type: tooltip
      for: "hui-tile-card $ ha-tile-icon"
      content: >-
        {{ state_attr(config.element.entity, 'friendly_name') }} is
        {{ states(config.element.entity) }}
element:
  type: tile
  entity: light.kitchen_lights

Tooltip spark with template content

Tooltip on a badge ​

Here the tooltip works on hui-badge which is the element forged by UIX Forge. Hence for: is not required as the default for: element will select hui-badge, the forged element. Generally tooltips will work with the default for: element and you only need to be more specific based on your specific use case.

yaml
# A badge placed in the dashboard header
    badges:
      - type: custom:uix-forge
        forge:
          mold: badge
          sparks:
            - type: tooltip
              content: >-
                {{ state_attr(config.element.entity, 'friendly_name') }} is
                {{ states(config.element.entity) }}
        element:
          type: entity
          entity: binary_sensor.movement_backyard

Tooltip spark as applied to a badge

Customising tooltip appearance ​

The tooltip spark injects CSS variables into the wa-tooltip element. Override them by setting --uix-tooltip-* variables on the forged element's uix.style (or in a theme).

INFO

As a tooltip is added as a sibling to the element it is for, if you wish to style the tooltip you will need to make sure your styled element is a parent of the for element. In the styling example, the styles are applied to :host and the tooltip applied to ha-card in the hosts shadow root.

yaml
type: custom:uix-forge
forge:
  mold: card
  sparks:
    - type: tooltip
      for: hui-tile-card $ ha-card
      content: Custom styled tooltip
element:
  type: tile
  entity: light.kitchen_lights
  uix:
    style: |
      :host {
        --uix-tooltip-background-color: #333;
        --uix-tooltip-content-color: #fff;
        --uix-tooltip-border-radius: 999px;
      }

Tooltip spark with custom styling

CSS variables reference ​

INFO

The following CSS var defaults were updated in 8.3.0.

  • --uix-tooltip-background-color (default now var(--ha-color-surface-default))
  • --uix-tooltip-content-color (add --ha-tooltip-text-color to default chain)
  • --uix-tooltip-font-size (default now --ha-font-size-m)
  • --uix-tooltip-padding (updated token size default resolving to same 8px)
  • --uix-tooltip-border-radius (default now --ha-border-radius-md)
  • --uix-tooltip-box-shadow (now uses --ha-tooltip-box-shadow and defaults to var(--ha-box-shadow-m))
CSS variableDefaultDescription
--uix-tooltip-background-colorvar(--ha-tooltip-background-color, var(--ha-color-surface-default))Tooltip background color.
--uix-tooltip-content-colorvar(--ha-tooltip-text-color, var(--primary-text-color))Tooltip text color.
--uix-tooltip-font-family--ha-font-family-bodyFont family.
--uix-tooltip-font-size--ha-font-size-mFont size.
--uix-tooltip-font-weight--ha-font-weight-mediumFont weight.
--uix-tooltip-line-height--ha-line-height-condensedLine height.
--uix-tooltip-paddingvar(--ha-tooltip-padding, var(--ha-space-2))Padding inside the tooltip.
--uix-tooltip-border-radius--ha-border-radius-mdBorder radius.
--uix-tooltip-arrow-sizevar(--ha-tooltip-arrow-size, 8px)Size of the directional arrow. If you want to have no arrow either set without_arrow: true in tooltip config, or style --ha-tooltip-arrow-size: 0px or --uix-tooltip-arrow-size: 0px
--uix-tooltip-border-width—Border width (unset by default).
--uix-tooltip-border-color—Border color (unset by default).
--uix-tooltip-border-style—Border style (unset by default).
--uix-tooltip-max-width30chMaximum width of the tooltip.
--uix-tooltip-max-heightnoneMaximum height of the tooltip body.
--uix-tooltip-overflowvisibleOverflow behaviour for the tooltip body. Use auto to scroll constrained content.
--uix-tooltip-overflow-wrapnormalOverflow-wrap behaviour.
--uix-tooltip-show-duration100msDuration of the show animation.
--uix-tooltip-hide-duration100msDuration of the hide animation.
--uix-tooltip-opacity1Tooltip opacity.
--uix-tooltip-box-shadowvar(--ha-tooltip-box-shadow, var(--ha-box-shadow-m))Box shadow.
--uix-tooltip-text-aligncenterText alignment.
--uix-tooltip-text-decorationnoneText decoration.
--uix-tooltip-text-transformnoneText transform.