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.

Attribute spark ​

The attribute spark lets you replace or remove an HTML attribute on any element inside a forged element. A common use-case is removing or overriding the title attribute on an element so that the browser's native tooltip no longer appears, or so that a custom value is shown instead.

Configuration ​

KeyTypeRequiredDefaultDescription
typestring✅—Must be attribute.
attributestring✅—Name of the HTML attribute to target (e.g. title).
forstringelementCSS/UIX selector to the target element. Supports $ for shadow-root crossings (see DOM navigation). 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.
actionstringreplaceWhat to do with the attribute. Either replace (set a new value) or remove (delete the attribute entirely).
valuestring""The new attribute value. Only used when action is replace. Supports Jinja2 templates.

TIP

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

Usage ​

Remove a native tooltip (title attribute) ​

Weather forecast card has a title attribute on the name, which causes a native browser tooltip to appear on hover. To remove it:

yaml
type: custom:uix-forge
forge:
  mold: card
  sparks:
    - type: attribute
      for: hui-weather-forecast-card $ div.name
      attribute: title
      action: remove
element:
  show_current: true
  show_forecast: false
  type: weather-forecast
  entity: weather.carlingford
  forecast_type: daily

Replace the title attribute with a custom value ​

yaml
type: custom:uix-forge
forge:
  mold: card
  sparks:
    - type: attribute
      for: hui-weather-forecast-card $ div.name
      attribute: title
      action: replace
      value: Weather forecast for Carlingford and surrounding districts.
element:
  show_current: true
  show_forecast: false
  type: weather-forecast
  entity: weather.carlingford
  forecast_type: daily

Replace attribute example

Use a template for the value ​

The value field supports templates, giving you access to entity states and other template variables:

yaml
type: custom:uix-forge
forge:
  mold: card
  sparks:
    - type: attribute
      for: hui-tile-card
      attribute: title
      action: replace
      value: |
        {{ relative_time(states[config.element.entity].last_changed) }} ago
element:
  type: tile
  entity: light.bed_light

Replace attribute with template example

INFO

  • The spark targets the first matching element found by the for selector.
  • When action is replace and value is an empty string, an empty attribute (e.g. title="") is set — not removed. Use action: remove to delete the attribute entirely.