Button Card
custom:lcards-button
The LCARS building block: a toggle button, a label, a panel or a section header, or a D-pad, alert symbol or round display. Most buttons need only an entity and a preset.
- A button is drawn one of three ways: a
presetshape, acomponent(a D-pad, the alert symbol or bracket arcs), or your ownsvg. - The Elbow card is built on the button, so most of these pages apply to elbows too.
Try it
- The card editor's tabs cover the options on these pages, with a live preview.
- The Playground lets you edit button YAML here in the docs and see the result.
| Page | Covers |
|---|---|
| Style, Text and Hover | Background and border colours, text, hover and cursor, filters |
| Icons | The icon, its area beside the text, per-state icons, the divider |
| Textures and Backgrounds | Moving textures inside the shape and animated backgrounds |
| D-pads, Alerts and Brackets | The D-pad, Voyager D-pad, alert symbol and brackets |
| Custom SVG | Your own SVG with tappable parts |
| Playground | Edit YAML and see the button live |
Quick start
Two examples to start from: a light you toggle, and a section header.
- Presets hide their text until you ask for it:
text.name.show: trueshows the entity's name.
type: custom:lcards-button
entity: light.living_room
preset: lozenge
text:
name:
show: true
tap_action:
action: toggletype: custom:lcards-button
preset: bar-label-left
interactive: false
text:
label:
content: NAVIGATIONPresets
preset picks the shape and the text layout. Any style, text or icon key you set overrides the preset.
Standard Buttons
Filled, outlined and text-only buttons with rounded, half-rounded or square ends. The -right versions put the icon area on the right.
preset: lozengeYAML
type: custom:lcards-button
entity: light.demo
preset: lozenge
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: true
tap_action:
action: toggle
preset: lozenge-rightYAML
type: custom:lcards-button
entity: light.demo
preset: lozenge-right
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: true
tap_action:
action: toggle
preset: bulletYAML
type: custom:lcards-button
entity: light.demo
preset: bullet
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: true
tap_action:
action: toggle
preset: bullet-rightYAML
type: custom:lcards-button
entity: light.demo
preset: bullet-right
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: true
tap_action:
action: toggle
preset: cappedYAML
type: custom:lcards-button
entity: light.demo
preset: capped
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: true
tap_action:
action: toggle
preset: capped-rightYAML
type: custom:lcards-button
entity: light.demo
preset: capped-right
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: true
tap_action:
action: toggle
preset: barrelYAML
type: custom:lcards-button
entity: light.demo
preset: barrel
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: true
tap_action:
action: toggle
preset: barrel-rightYAML
type: custom:lcards-button
entity: light.demo
preset: barrel-right
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: true
tap_action:
action: toggle
preset: filledYAML
type: custom:lcards-button
entity: light.demo
preset: filled
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: true
tap_action:
action: toggle
preset: filled-rightYAML
type: custom:lcards-button
entity: light.demo
preset: filled-right
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: true
tap_action:
action: toggle
preset: outlineYAML
type: custom:lcards-button
entity: light.demo
preset: outline
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: true
tap_action:
action: toggle
preset: outline-rightYAML
type: custom:lcards-button
entity: light.demo
preset: outline-right
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: true
tap_action:
action: toggle
preset: iconYAML
type: custom:lcards-button
entity: light.demo
preset: icon
icon: mdi:lightbulb
tap_action:
action: toggle
preset: text-onlyYAML
type: custom:lcards-button
entity: light.demo
preset: text-only
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: true
tap_action:
action: toggle
preset: toggle-tabYAML
type: custom:lcards-button
entity: light.demo
preset: toggle-tab
icon: mdi:lightbulb
text:
label:
content: MAIN LIGHTS
show: false
tap_action:
action: toggle
Real cards with sample entities. Tap a button to toggle the sample light.
- The
toggle-tabline is the tab's top border, so it can go on any side at any thickness:style.border.width.left: 6withtop: 0moves it to the left edge.
| Preset | Description |
|---|---|
lozenge | Rounded at both ends, icon area on the left |
lozenge-right | Rounded at both ends, icon shown on the right |
bullet | Flat left end, rounded right end, icon area on the left |
bullet-right | Rounded left end, flat right end, icon shown on the right |
capped | Rounded left end, flat right end, icon area on the left |
capped-right | Flat left end, rounded right end, icon shown on the right |
barrel | Square corners, no border, icon area on the left |
barrel-right | Square corners, no border, icon area on the right |
filled | Square filled block with the name on the right |
filled-right | Square filled block with the name on the left |
outline | Transparent background with a border (Picard style) |
outline-right | Like outline, icon area on the right |
icon | Square icon-only button with rounded corners |
text-only | No background or border: text alone |
toggle-tab | Dark square tab with a centred name; a coloured line along the top shows the state |
Panels
Square-cornered blocks with a code label, for number columns and fillers. With an entity they show the theme accent when on and the dark structure tone when off.
- Panels are decorative: they set
interactive: false, so they don't change colour on hover.
preset: panel-lightYAML
type: custom:lcards-button
preset: panel-light
preset: panel-flaggedYAML
type: custom:lcards-button
preset: panel-flagged
preset: panel-darkYAML
type: custom:lcards-button
preset: panel-dark
Real cards with sample entities.
| Preset | Description |
|---|---|
panel-light | Light structure block with a code label |
panel-dark | Dark structure block with a code label |
panel-flagged | Dark code block with a thin accent flag on its left edge |
Bar Labels
Horizontal bars whose text sits on a black background that breaks the bar: the classic LCARS header. The text grows with the card's height.
- A bar label is 56 px tall (one sections-view row) unless you set
height.
preset: bar-label-baseYAML
type: custom:lcards-button
preset: bar-label-base
interactive: false
text:
label:
content: ENGINEERING
preset: bar-label-leftYAML
type: custom:lcards-button
preset: bar-label-left
interactive: false
text:
label:
content: ENGINEERING
preset: bar-label-centerYAML
type: custom:lcards-button
preset: bar-label-center
interactive: false
text:
label:
content: ENGINEERING
preset: bar-label-rightYAML
type: custom:lcards-button
preset: bar-label-right
interactive: false
text:
label:
content: ENGINEERING
preset: bar-label-squareYAML
type: custom:lcards-button
preset: bar-label-square
interactive: false
text:
label:
content: ENGINEERING
preset: bar-label-lozengeYAML
type: custom:lcards-button
preset: bar-label-lozenge
interactive: false
text:
label:
content: ENGINEERING
preset: bar-label-bullet-leftYAML
type: custom:lcards-button
preset: bar-label-bullet-left
interactive: false
text:
label:
content: ENGINEERING
preset: bar-label-bullet-rightYAML
type: custom:lcards-button
preset: bar-label-bullet-right
interactive: false
text:
label:
content: ENGINEERING
preset: bar-label-capped-leftYAML
type: custom:lcards-button
preset: bar-label-capped-left
interactive: false
text:
label:
content: ENGINEERING
preset: bar-label-capped-rightYAML
type: custom:lcards-button
preset: bar-label-capped-right
interactive: false
text:
label:
content: ENGINEERING
Real cards with sample entities.
| Preset | Description |
|---|---|
bar-label-base | Bar label foundation: filled bar, text that scales with the height, centred |
bar-label-left | Text on the left |
bar-label-center | Text centred |
bar-label-right | Text on the right |
bar-label-square | Square corners |
bar-label-lozenge | Rounded at both ends |
bar-label-bullet-left | Flat left end, rounded right end |
bar-label-bullet-right | Rounded left end, flat right end |
bar-label-capped-left | Rounded left end, flat right end |
bar-label-capped-right | Flat left end, rounded right end |
Card options
The button's own top-level keys. Each block has its own page; this table links to it.
- The button also takes the keys every LCARdS card takes (
height,width,grid_options,id,tags,tap_action,hold_action,double_tap_action,animations,sounds,data_sources,rules...): see Common card properties. - Set one of
preset,componentorsvg. Withcomponent,presetnames the component's own preset (such ascondition_redon the alert).
type: custom:lcards-button
entity: light.living_room
preset: lozenge-right
icon: mdi:sofa
text:
name:
show: true
tap_action:
action: toggle
hold_action:
action: more-info| Key | Type | Default | Description |
|---|---|---|---|
type | string | required | custom:lcards-button |
entity | string | - | The entity the button shows and acts on |
preset | string | - | The shape: see Presets. With component, the component's preset |
component | string | - | dpad, dpad_voyager, alert or brackets: see D-pads, Alerts and Brackets |
svg | object | - | Your own SVG: see Custom SVG |
style | object | from the preset | Background, border, cursor and text defaults: see Style, Text and Hover |
text | object | from the preset | Text on the card: see Text fields |
interactive | boolean | true with an action or a switchable entity, else false | false: no hover colour or hover animations. See interactive |
filters | list | - | CSS and SVG filters: see filters |
show_icon | boolean | false, true on some presets | Show the icon: see Icons |
icon | string | the entity's icon | The icon: see Icons |
icon_area | string | left | Where the icon's area sits: see Icons |
icon_area_size | number | fits the icon | Width (or height) of the icon area: see Icons |
icon_area_background | colour / state map | - | Background of the icon area: see Icons |
icon_style | object | - | Icon colour, size, position: see icon_style |
divider | object | from the preset | The line between icon and text: see divider |
shape_texture | object | - | A texture inside the shape: see shape_texture |
background_animation | list | - | An animated background: see background_animation |
dpad | object | - | D-pad segments: see dpad |
dpad_voyager | object | - | Voyager D-pad segments: see dpad_voyager |
brackets | object | - | Bracket segments: see Brackets |
alert | object | - | Alert colours and presets: see alert |
ranges | list | - | Switch the component's preset by value: see ranges |
ranges_attribute | string | the state | The attribute that range colours and ranges compare |
state_attribute | string | - | The attribute whose value picks exact-match colours |
state_classification | object | - | Which states count as active or inactive: see state_classification |