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

Pills and Gauges ​

The two flat looks of the slider card: a row of pills that light up to the value, or a ruler gauge with a fill bar. Pick one with a pills-* or gauge-* preset, or set style.track.type.

  • Both looks lie flat by default. Set style.track.orientation: vertical to stand one upright; the fill then rises from the bottom.
  • Every colour key on this page takes a colour, a CSS variable, a theme token or a state map (default, active, inactive ...), as described on the Colours page.

The ring, shaped and Picard looks have their own page.


style.track ​

The track is the bar both looks are drawn in: its size, the scale it shows and, for pills, the pills themselves.

  • Leave segments.count out and the card fits as many pills of segments.size.width as the width allows. Set it and that many pills stretch to share the space.
  • display changes only the scale the card shows. What the slider sets on the entity is control.min and max.
yaml
type: custom:lcards-slider
entity: light.bedroom
preset: pills-basic
style:
  track:
    segments:
      count: 10
      gap: 6
      gradient:
        start: var(--lcars-orange)
        end: var(--lcards-moonlight)
More about style.track
  • Upright pills: with no count, an upright track fits as many pills of segments.size.height as the height allows, then stretches them a little so they fill it exactly. A flat track keeps the pill width you set and leaves any spare room at the end.
  • Inverted fill: with invert_fill: true the pill gradient swaps ends too, so the start colour stays where the fill starts.
  • Border caps and margin: the track starts inside any border caps; margin adds space inside them.
KeyTypeDefaultDescription
typestringpresetpills or gauge. shaped is set for you by the shaped component
orientationstringhorizontalhorizontal or vertical
heightnumber / stringthemeTrack height: px, a px or rem string, or a theme token
invert_fillbooleanfalseTurn the track round: the fill, the drag direction and the scale start from the other end (right, or top when upright)
marginnumber0Space on every side of the track, px. Or set each side with the keys below
margin.topnumber0 (pills presets: 5)Space above the track, px
margin.rightnumber0Space right of the track, px
margin.bottomnumber0Space below the track, px
margin.leftnumber0 (pills presets: 5)Space left of the track, px
display.minnumbercontrol.minLowest value on the scale
display.maxnumbercontrol.maxHighest value on the scale
display.unitstringentity unitUnit shown, instead of the entity's unit_of_measurement
segments.countnumberas many as fitNumber of pills, 2 to 200. Unset, as many size-wide pills as fit; set, the pills stretch to fill
segments.gapnumber / string4Gap between pills, px
segments.shape.radiusnumber0 (pills presets)Pill corner radius, px
segments.size.widthnumber10 (pills presets)Pill width, px. Flat tracks, and only when count is unset
segments.size.heightnumber12Pill height, px. Upright tracks, and only when count is unset
segments.gradient.startcolourthemeColour of the first pill; a state map works
segments.gradient.endcolourthemeColour of the last pill
segments.appearance.filled.opacitynumber1Opacity of lit pills, 0–1
segments.appearance.unfilled.opacitynumber0.2Opacity of unlit pills, 0–1

style.gauge ​

The gauge's fill bar, its ruler of ticks and labels, the value indicator, and the defaults for value markers. progress_bar is the fill, scale the ruler, indicator the mark at the current value.

  • The value indicator is off until you set indicator.type, color or size, or enabled: true. A triangle points down; rotation: 180 points it up at the ruler.
  • Value markers (ranges with a value) take their shape from marker_indicator, and a marker's own indicator keys win over it. A marker's colour is its range's color (or its indicator.color); marker_indicator.color is the default when it sets neither.
yaml
type: custom:lcards-slider
entity: sensor.temperature
preset: gauge-basic
style:
  track:
    height: 48
    display:
      min: -20
      max: 45
      unit: "°C"
  gauge:
    progress_bar:
      color: var(--lcards-blue)
      radius: 4
      background:
        color: var(--lcards-gray-darkest)
    scale:
      tick_marks:
        major:
          interval: 10
          color: var(--lcards-moonlight)
          height: 12
        minor:
          interval: 5
          color: var(--lcards-gray)
          height: 6
      labels:
        color: var(--lcards-moonlight)
    indicator:
      type: triangle
      rotation: 180 # point up at the ruler
      size:
        width: 18
        height: 16
      color: var(--lcars-orange)
More about style.gauge
  • Per-end radius: progress_bar.radius and progress_bar.background.radius take a number for both ends, or start and end keys. start is the left end (bottom when upright), end the right end (top when upright).
  • Turning the indicator on with a template: indicator.enabled takes a template that gives true or false, for example "{{ not is_state('sensor.x', 'unavailable') }}".
  • Marker defaults on a ring: a ring takes only marker_indicator.color from this block.
  • Marker offset on bordered gauges: the gauge-left-border presets set marker_indicator.offset.y: 20, so the marker clears the top cap and its tip meets the minor ticks.
KeyTypeDefaultDescription
progress_bar.colorcolourthemeFill colour; a state map works
progress_bar.heightnumberthe trackFill thickness, px
progress_bar.layerstringbackgroundbackground (behind the ticks) or foreground (in front)
progress_bar.alignstringmiddleWhere the fill sits across the track: start, middle or end
progress_bar.padding.topnumber0Nudge from the aligned place, px
progress_bar.padding.rightnumber0Nudge from the aligned place, px
progress_bar.padding.bottomnumber0Nudge from the aligned place, px
progress_bar.padding.leftnumber0Nudge from the aligned place, px
progress_bar.radiusnumber2Corner radius, px
progress_bar.radius.startnumber2Radius at the start end only, px
progress_bar.radius.endnumber2Radius at the far end only, px
progress_bar.background.colorcolour-The empty track behind the fill. Unset, there is none
progress_bar.background.heightnumberas the barEmpty track thickness, px
progress_bar.background.radiusnumberas the barEmpty track corner radius, px. Takes start and end as the bar does
progress_bar.background.minnumbercontrol.minValue where the empty track starts
progress_bar.background.maxnumbercontrol.maxValue where the empty track ends
scale.tick_marks.major.enabledbooleantrueShow major ticks
scale.tick_marks.major.intervalnumber10A major tick every this many value units, widened to fit when the range is too large for the track (majors stay at least 8 px apart); a fraction (0.5) suits a small range, and the labels show its decimals
scale.tick_marks.major.colorcolourthemeMajor tick colour
scale.tick_marks.major.heightnumberthe trackMajor tick length, px
scale.tick_marks.major.widthnumber2Major tick width, px
scale.tick_marks.minor.enabledbooleantrueShow the minor ticks between the major ones
scale.tick_marks.minor.intervalnumber2A minor tick every this many value units; fractions work. On a widened scale the minors split each major evenly
scale.tick_marks.minor.colorcolourthemeMinor tick colour
scale.tick_marks.minor.heightnumber10Minor tick length, px
scale.tick_marks.minor.widthnumber1Minor tick width, px
scale.labels.enabledbooleantrueShow the value labels
scale.labels.show_unitbooleantrueAdd the unit to each label
scale.labels.unitstringentity unitUnit on the labels
scale.labels.colorcolourthemeLabel colour
scale.labels.font_sizenumber14Label size, px
scale.labels.paddingnumber3Space round the labels, px
scale.labels.alignstringendend: at the far edge (right of an upright gauge, under a level one). start: beside the ticks, so a narrow gauge stays one column in a wide card
indicator.enabledboolean / stringoffShow the value indicator. Setting type, color or size also turns it on
indicator.typestringlineline, round or triangle
indicator.colorcolourthemeIndicator colour; a state map works
indicator.size.widthnumber4Indicator width, px
indicator.size.heightnumber25Indicator height, px
indicator.rotationnumber0Turn, degrees, -180 to 180. 180 points a triangle up
indicator.offset.xnumber0Nudge sideways, px
indicator.offset.ynumber0Nudge up or down, px
indicator.border.enabledbooleantrueAn outline round the indicator; false removes it
indicator.border.widthnumber1Outline width, px
indicator.border.colorcolourthemeOutline colour
marker_indicator.typestringtriangleMarker shape: line, round or triangle
marker_indicator.alignstringstartWhere the marker sits across the track: start, center or end
marker_indicator.size.widthnumber20Marker width, px
marker_indicator.size.heightnumber20Marker height, px
marker_indicator.rotationnumber180Turn, degrees; 180 points a triangle at the ticks
marker_indicator.offset.xnumber0Nudge from the aligned place, px (used on upright gauges)
marker_indicator.offset.ynumber10 (flat), 0 (upright)Nudge from the aligned place, px (used on flat gauges)
marker_indicator.colorcolourthemeMarker colour
marker_indicator.border.enabledbooleanfalseAn outline round each marker
marker_indicator.border.widthnumber1Outline width, px
marker_indicator.border.colorcolourthemeOutline colour

style.border ​

LCARS caps on the ends and sides of the track, with an optional rounded card outline. A left cap alone is the classic LCARS end.

  • A cap is drawn only when its side has enabled: true and a size above 0. The track then starts inside it.
  • Text fields without a zone go into the first cap that is on, in the order left, right, top, bottom. See Text labels.
  • radius rounds the corners of the whole card, caps and track together.
yaml
type: custom:lcards-slider
entity: light.bedroom
preset: pills-basic
style:
  border:
    radius: 8
    left:
      enabled: true
      size: 20
      color:
        default: var(--lcards-gray)
        active: var(--lcars-orange)
More about style.border
  • Rounding one end: set the corner keys instead of one number, for example top_right: 12 and bottom_right: 12 with the left corners at 0. The *-left-border-rounded presets do this, so the capped end stays square.
  • Large radii: a corner's radius is capped at half the card's shorter side.
  • Hover and press: a cap's state map also takes hover and pressed colours.
KeyTypeDefaultDescription
radiusnumber / string-Corner radius of the card: px, a px or rem string, or a CSS variable such as var(--ha-card-border-radius, var(--ha-border-radius-lg)) (a theme variable: give it a fallback). Unset, the corners are square
radius.top_leftnumber / string0One corner only, px or a CSS variable
radius.top_rightnumber / string0One corner only
radius.bottom_rightnumber / string0One corner only
radius.bottom_leftnumber / string0One corner only
left.enabledbooleanfalseDraw the left cap
left.sizenumber0Left cap width, px
left.colorcolourthemeLeft cap colour; a state map works
right.enabledbooleanfalseDraw the right cap
right.sizenumber0Right cap width, px
right.colorcolourthemeRight cap colour
top.enabledbooleanfalseDraw the top cap
top.sizenumber0Top cap height, px
top.colorcolourthemeTop cap colour
bottom.enabledbooleanfalseDraw the bottom cap
bottom.sizenumber0Bottom cap height, px
bottom.colorcolourthemeBottom cap colour

Text labels ​

Text fields of your own, such as a label and a read-out of the value. The pills and gauge presets show no text until you add some.

  • A field without a zone goes into the first border cap that is on. Set zone: track to put it over the track instead.
  • The presets already hold a name field (the entity's name) and a state field (the value) that are hidden. Turn one on with show: true; the ring and shaped presets already show both.
  • Every text field key works here, including templates in content.
yaml
type: custom:lcards-slider
entity: light.bedroom
preset: pills-left-border
text:
  default:
    color: var(--lcards-moonlight)
  label:
    content: Brightness
    zone: track
    position: top-left
    font_size: 11
  value:
    content: "[[[return Math.round(entity.attributes.brightness / 255 * 100) + '%']]]"
    zone: track
    position: top-right
    font_size: 11
More about text labels
  • Missing zones: a zone that does not exist on the card, such as a cap that is off, puts the field over the track.
  • Preset text style: the presets set text.default to the theme's LCARS font in upper case.
KeyTypeDefaultDescription
text.<name>object-A text field of your own; any name except default
text.<name>.contentstring-The text; templates work
text.<name>.zonestringfirst capleft, right, top or bottom (a cap that is on), or track. With no cap on, track
text.<name>.positionstringfrom defaultWhere in the zone: top-left, center, bottom-right ... (see Placing text)
text.<name>.showbooleantrueShow or hide the field
text.defaultobjecttheme font, upper caseStyle every field inherits. It is not drawn itself
text.name.showbooleanfalseShow the entity's name
text.state.showbooleanfalseShow the value: a light's brightness as a percentage, otherwise the entity's state
Text field keysfont_size, color, font_weight, text_transform and the rest

Putting it together ​

A thermostat: a gauge with its own scale, coloured comfort bands, a state-coloured fill and a left cap.

yaml
type: custom:lcards-slider
entity: climate.living_room
preset: gauge-basic
control:
  attribute: temperature
  min: 15
  max: 30
  step: 0.5
text:
  label:
    content: Living Room
    zone: track # over the track, not in the left cap
    position: top-left
    font_size: 11
    text_transform: uppercase
  value:
    content: "[[[return entity.attributes.current_temperature + '°C']]]"
    zone: track
    position: top-right
    font_size: 11
style:
  track:
    height: 52
    display:
      unit: "°C"
  gauge:
    progress_bar:
      color:
        default: var(--lcards-blue)
        heat: var(--lcars-alert-red)
        cool: var(--lcards-blue)
      radius: 3
    scale:
      tick_marks:
        major:
          interval: 5
        minor:
          interval: 1
    indicator:
      type: triangle
      rotation: 180
      size:
        width: 18
        height: 16
      color: var(--lcars-orange)
  ranges:
    - min: 15
      max: 19
      color: var(--lcards-blue)
      opacity: 0.25
    - min: 19
      max: 24
      color: theme:colors.status.success
      opacity: 0.25
    - min: 24
      max: 30
      color: theme:colors.status.error
      opacity: 0.25
  border:
    radius: 8
    left:
      enabled: true
      size: 20
      color:
        default: var(--lcards-gray)
        active: var(--lcars-orange)
tap_action:
  action: more-info

Released under the MIT License. | About