You are reading the development docs (2026.12.1-dev.1): features here may not be released yet.
Skip to content

Actions ​

What a card does when you tap it, hold it or double-tap it: toggle a light, run any Home Assistant action, open a dashboard, a page or a dialog. Actions follow Home Assistant's own action model, so YAML from Home Assistant's cards works here too.

  • A card takes up to three actions: tap_action, hold_action and double_tap_action. Each is an object whose action key picks what happens.
  • The button, elbow, slider, select menu, data grid and astrometrics cards take actions; each card's page says where on the card they apply.

Quick start ​

A button that raises a red alert when tapped and clears it when held. Try it here: the alert recolours this page.

yaml
type: custom:lcards-button
preset: lozenge
text:
  label:
    content: RED ALERT
    show: true
# tap: raise a red alert
tap_action:
  action: perform-action
  perform_action: lcards.red_alert
# hold: back to normal
hold_action:
  action: perform-action
  perform_action: lcards.clear_alert

Action types ​

The action key picks what happens: toggle the entity, run an action, open a dashboard, a page or a dialog, or nothing.

  • toggle picks its service as Home Assistant's own cards do: from off, closed or locked it turns the entity on, from any other state off.
  • none is how to stop a card's default: a button toggles its entity on a tap until its tap_action says otherwise.
yaml
type: custom:lcards-button
entity: input_boolean.lcards_test_lights
preset: lozenge
text:
  name:
    show: true
tap_action:
  action: toggle
actionWhat it does
toggleToggle the entity. Locks unlock and lock, covers and valves open and close, buttons are pressed, scenes are turned on
perform-actionRun a Home Assistant action: name it in perform_action and give its data in data
call-serviceThe older name for perform-action
more-infoOpen Home Assistant's more-info dialog for the entity
navigateGo to another dashboard or view (navigation_path)
urlOpen an address in a new browser tab (url_path)
assistOpen Home Assistant's Assist dialog
fire-dom-eventFire Home Assistant's ll-custom event with the whole action, for integrations that listen for it such as browser_mod or Local Conditional Card. Add whatever keys the integration reads (browser_mod:, local_conditional_card:)
fly-to, set-clock, set-model-scale, point-cardMove the camera, the scene date or the model size of an astrometrics card, or open a card on one of its points: see Scene actions and Opening cards from other cards
noneDo nothing, in place of the card's default
More about toggle
  • Groups toggle through Home Assistant's homeassistant domain (homeassistant.turn_on, homeassistant.turn_off).
  • An entity with no state yet gets its domain's own toggle action (light.toggle).

Action keys ​

The keys of an action object, besides action: which entity it acts on, what to run, and where to go.

  • target goes to Home Assistant as the action's target, separate from data, as Home Assistant's own cards send it.
  • The older names call-service, service and service_data still work, and the config checker suggests the current one. When an action sets both an old and a new name, the new one wins, as in Home Assistant.
yaml
type: custom:lcards-button
entity: input_boolean.lcards_test_doors
preset: lozenge
text:
  name:
    show: true
# tap: turn the doors on
tap_action:
  action: perform-action
  perform_action: input_boolean.turn_on
  target:
    entity_id: input_boolean.lcards_test_doors
# hold: turn them off
hold_action:
  action: perform-action
  perform_action: input_boolean.turn_off
  target:
    entity_id: input_boolean.lcards_test_doors
KeyTypeDefaultDescription
actionstringrequiredWhat happens: see Action types
entitystringthe card's entityThe entity toggle and more-info act on
perform_actionstring-perform-action: the action to run, as domain.action (light.turn_on)
servicestring-The older name for perform_action
dataobject-perform-action: the action's data (brightness_pct: 50)
service_dataobject-The older name for data
targetobject-perform-action: what the action acts on
target.entity_idstring / list-Entity ids to act on
target.device_idstring / list-Device ids to act on
target.area_idstring / list-Area ids to act on
browser_modobject-fire-dom-event: what browser_mod runs, in its own grammar (service and data): see browser_mod
navigation_pathstring-navigate: the dashboard path, starting with / (/lovelace/bridge). Required
navigation_replacebooleanfalsenavigate: replace the current page in the browser history, so Back skips it
url_pathstring-url: the address to open. Required
pipeline_idstringpreferredassist: the Assist pipeline to use
start_listeningbooleantrueassist: start listening as soon as the dialog opens
confirmationboolean / object-Ask before running: see Confirmation
Scene action keyscard, view, point, duration, warp, date, rate and model_scale for the astrometrics actions

Confirmation ​

Ask before an action runs, as Home Assistant's own cards do: confirmation: true, or your own question and buttons.

  • confirmation works on every action type, including the astrometrics actions. The card's tap sound and animation still play straight away; only the action waits for the answer.
  • With confirmation: true the dialog asks Home Assistant's own translated question naming the action ("Are you sure you want to run action 'Light: Turn on'?").
  • Users listed in exemptions are not asked: the action runs straight away for them. A user's ID is in Settings > People > Users (with advanced mode on in your profile).
yaml
type: custom:lcards-button
entity: input_boolean.lcards_test_doors
preset: lozenge
text:
  name:
    show: true
tap_action:
  action: toggle
  confirmation:
    title: Airlock
    text: Cycle the airlock doors?
    confirm_text: Cycle
    dismiss_text: Stay
    exemptions:
      - user: 0123456789abcdef0123456789abcdef
More about confirmation
  • Cancel, Esc or a tap outside the dialog runs nothing.
  • The phone vibrates with Home Assistant's warning haptic when the dialog opens, in the companion apps.
  • navigation_replace is the other Home Assistant action key LCARdS reads: on navigate it replaces the current page in the browser history, so Back goes past it.
KeyTypeDefaultDescription
confirmationboolean / object-true asks Home Assistant's default question; an object sets the keys below
confirmation.textstringHome Assistant's questionThe question
confirmation.titlestring-Dialog heading
confirmation.confirm_textstringOK (translated)Confirm button label
confirmation.dismiss_textstringCancel (translated)Dismiss button label
confirmation.exemptionslist-Users who are not asked, each user: <user id>

Tap, hold and double-tap ​

When each of the three actions runs. A hold is a press of half a second; a double tap is two taps close together.

  • A hold runs hold_action after 500 ms, and the tap that would follow when you let go is skipped.
  • When a card has a double_tap_action, a single tap waits 300 ms for a second tap before it runs tap_action. A card without one runs its tap at once.
  • Each action can name its own entity, so one card can control several things.
yaml
type: custom:lcards-button
entity: input_boolean.lcards_test_lights
preset: lozenge
text:
  name:
    show: true
# tap: the lights
tap_action:
  action: toggle
# double tap: the doors
double_tap_action:
  action: toggle
  entity: input_boolean.lcards_test_doors
KeyTypeDefaultDescription
tap_actionobjecttoggle on a button, none on an elbow or sliderWhat a tap does. The select menu, data grid and astrometrics pages give their own defaults
hold_actionobject-What a press held for 500 ms does
double_tap_actionobject-What two taps within 300 ms do

Hover and cursor ​

The button and elbow cards change colour and can animate when the mouse pointer is over them, and show a hand cursor. Two card-level keys (not keys of an action) turn that off or change the cursor.

interactive ​

interactive: false makes a button or elbow decorative: no hover colour, no hover animations and the arrow cursor. Use it for a label or panel that should not look clickable.

  • A button or elbow with no action, no animation a pointer starts (on_tap, on_hover, ...) and no entity a tap can toggle is decorative already (a title, a sweep, a filler, a sensor readout); set interactive: true to give it hover effects anyway.
  • Tap, hold and double-tap actions still run on a card with interactive: false.
  • The hover sound (card_hover, see Card Sounds) does not play either.
yaml
type: custom:lcards-button
entity: input_boolean.lcards_test_lights
preset: lozenge
# decorative: no hand cursor or hover effects
interactive: false
text:
  name:
    show: true
# still runs on a tap
tap_action:
  action: toggle
KeyTypeDefaultDescription
interactivebooleantrue with an action or a switchable entity, else falsefalse: no hover colour, hover animations or hover sound, and the arrow cursor. Actions still run

style.cursor ​

The mouse cursor over a button or elbow, whatever interactive says. Use it for hover effects with another cursor shape, or for the hand cursor on a decorative card.

yaml
type: custom:lcards-button
preset: lozenge
text:
  label:
    content: TARGET
    show: true
style:
  cursor: crosshair
KeyTypeDefaultDescription
style.cursorstringpointer, or default with interactive: falseAny CSS cursor: pointer, default, none, not-allowed, crosshair, grab, zoom-in, help, wait, progress, move, copy, text

Released under the MIT License. | About