Skip to content

Slider Card

custom:lcards-slider

Interactive sliders and read-only gauges for entities like lights, covers, fans, climate, and sensors. Three main visual styles: segmented pill bars, ruler gauges, and shaped (clip-path fill).


Quick Start

yaml
# Light brightness slider
type: custom:lcards-slider
entity: light.bedroom
preset: pills-left-border
control:
  attribute: brightness
yaml
# Temperature gauge (read-only)
type: custom:lcards-slider
entity: sensor.temperature
preset: gauge-basic
style:
  track:
    display:
      min: -10
      max: 40
      unit: "°C"

Common Properties

The following properties are shared across all LCARdS cards. See Common Card Properties for full details.

CategoryConfig keysReference
Sizingheight, width, min_height, min_width, max_height, max_widthSizing
Overflowoverflow, overflow_x, overflow_yOverflow
Stackingz_indexStacking
Identityid, tagsID & Tags
HA Gridgrid_optionsHA Grid Sizing
Datadata_sources, triggers_updateData Sources
Text labelstextText Fields
Actionstap_action, hold_action, double_tap_actionActions
Animationsanimations, background_animationAnimations
SoundssoundsSounds
Rulesvia id / tagsRules Engine

Config Structure

Annotated map of all top-level keys.

yaml
type: custom:lcards-slider

# ── Entity & mode ─────────────────────────────────────────────────────────────────
entity: light.bedroom      # entity to display / control
ranges_attribute: ""       # entity attribute for range conditions
preset: pills-left-border  # visual preset — see Presets
component: shaped          # advanced: 'shaped' or 'picard'

# ── Control ─────────────────────────────────────────────────────────────────────
control:
  attribute: brightness    # entity attribute to control
  min: 0
  max: 100
  step: 1
  locked: false            # force read-only
  invert_value: false

# ── Text labels ────────────────────────────────────────────────────────────────
text:
  label:
    content: Brightness
    position: top-left

# ── Style ───────────────────────────────────────────────────────────────────────
style:
  track:
    type: pills              # pills | gauge | shaped
    height: 40
    display:
      min: 0
      max: 100
      unit: "%"
    segments:
      gradient:
        start:               # string or state-based object
          default: "var(--lcars-orange)"
          inactive: "alpha(var(--lcars-orange), 0.3)"
        end:                 # string or state-based object
          default: "var(--lcars-moonlight)"
  gauge:
    color:                   # string or state-based object (gauge fill)
      default: "var(--lcars-orange)"
      inactive: "var(--lcars-gray)"
  border:
    left:
      enabled: true
      size: 12
      color:                 # string or state-based object
        default: "var(--lcars-orange)"

# ── Actions, animations & effects ────────────────────────────────────────────
tap_action:
  action: more-info
animations: []
background_animation: []
value_tween:                # see Value Tween below
  enabled: true
  duration: 500
  ease: outQuad
drag_badge:                  # see Drag Value Badge below
  enabled: true
sounds: {}

# ── Layout ─────────────────────────────────────────────────────────────────────
height: 60
width: 300
min_height: 40
max_height: 120
overflow: hidden
z_index: 0
grid_options:
  columns: 6
  rows: 1
id: my-slider
tags: [controls]
data_sources: {}
triggers_update: []

Card Options

OptionTypeDescription
typestringcustom:lcards-slider (required)
entitystringEntity to display and/or control
ranges_attributestringEntity attribute for range conditions — see Range Conditions
presetstringVisual style preset — see Presets
componentstringAdvanced SVG component: shaped or picard
controlobjectControl behaviour — see Control Options
textobjectText label definitions — see Text Fields
styleobjectVisual style overrides — see Style Object
value_tweenobjectEase the track (fill or pills) and markers between values on entity-driven changes — see Value Tween
drag_badgeobjectFloating badge showing the live value while dragging — see Drag Value Badge

Presets

PresetDescription
pills-basicSegmented pill slider (horizontal, default)
pills-left-borderPills slider with left border cap
pills-left-border-roundedPills + left border, right end rounded for LCARS end-cap look
gauge-basicRuler-style gauge with tick marks and progress bar
gauge-left-borderGauge with left border cap; marker indicators pinned to tick edge
gauge-left-border-roundedGauge + left border, right end rounded
shaped-verticalVertical lozenge fill with top/bottom text bands (component: shaped)
shaped-horizontalHorizontal lozenge fill with left/right text bands (component: shaped)
picard-gauge-verticalPicard-style vertical gauge (component: picard)

Control Options

yaml
control:
  attribute: brightness    # Entity attribute to control (default varies by domain)
  min: 0                   # Minimum value
  max: 100                 # Maximum value
  step: 1                  # Value increment
  locked: false            # Force read-only (auto-determined by entity domain)
  invert_value: false      # Flip min↔max mapping
FieldTypeDefaultDescription
attributestringdomain defaultEntity attribute to control
minnumberdomain defaultMinimum value
maxnumberdomain defaultMaximum value
stepnumberdomain defaultValue increment
lockedbooleanautoForce read-only (true) or interactive (false)
invert_valuebooleanfalseFlip the min↔max mapping

Automatic Domain Behaviour

The slider auto-detects interactivity and default attribute from the entity domain:

DomainInteractiveDefault attributeControl range
lightYesbrightness0 – 100 (%)
coverYescurrent_position0 – 100
fanYespercentage0 – 100
climateYestemperaturemin_tempmax_temp from entity
water_heaterYestemperaturemin_tempmax_temp from entity
media_playerYesvolume_level0.0 – 1.0
humidifierYeshumiditymin_humiditymax_humidity
valveYescurrent_valve_position0 – 100
input_numberYesstateentity min/max/step
numberYesstateentity min/max/step
sensorNo (read-only)state

All other domains default to read-only (locked). Set control.locked: true/false to override.


Style Object

style.track

FieldTypeDefaultDescription
typestringpreset defaultpills, gauge, or shaped
orientationstringhorizontalhorizontal or vertical
heightnumber / stringthemeTrack height in px or CSS value
marginnumber / objectthemeSpace around track — number (all sides) or { top, right, bottom, left }
invert_fillbooleanfalseFill from the opposite end (right/top instead of left/bottom)
display.minnumbercontrol.minMinimum value shown on visual scale
display.maxnumbercontrol.maxMaximum value shown on visual scale
display.unitstringentity unitDisplay unit — overrides entity unit_of_measurement
segments.enabledbooleantrueEnable pill segments (pills mode)
segments.countnumber15Number of pill segments
segments.gapnumber / string4Gap between pills in px
segments.shape.radiusnumber4Pill corner radius in px
segments.size.widthnumber12Fixed pill width in px (horizontal orientation)
segments.size.heightnumber12Fixed pill height in px (vertical orientation)
segments.gradient.startstringGradient start colour
segments.gradient.endstringGradient end colour
segments.appearance.filled.opacitynumberOpacity of filled pills (0–1)
segments.appearance.unfilled.opacitynumberOpacity of unfilled pills (0–1)

style.gauge

FieldTypeDefaultDescription
progress_bar.colorstring / objectthemeFilled bar colour — state map supported
progress_bar.heightnumberthemeBar cross-sectional thickness in px
progress_bar.layerstringbackgroundbackground (behind ticks) or foreground (in front)
progress_bar.alignstringmiddleCross-axis alignment: start, middle, or end
progress_bar.paddingobjectFine-tune offset from aligned position: { top, right, bottom, left }
progress_bar.radiusnumber / objectCorner radius in px, or { start, end } per-end
progress_bar.background.colorstring / objectBackground track colour (drawn behind fill)
progress_bar.background.heightnumbersame as barBackground track cross-section in px
progress_bar.background.radiusnumber / objectBackground track corner radius or { start, end }
progress_bar.background.minnumbercontrol.minValue where background track starts
progress_bar.background.maxnumbercontrol.maxValue where background track ends
scale.tick_marks.major.enabledbooleantrueShow major ticks
scale.tick_marks.major.intervalnumberMajor tick interval in value units
scale.tick_marks.major.colorstring / objectthemeMajor tick colour
scale.tick_marks.major.heightnumberMajor tick height in px
scale.tick_marks.major.widthnumberMajor tick width in px
scale.tick_marks.minor.enabledbooleantrueShow minor ticks
scale.tick_marks.minor.intervalnumberMinor tick interval in value units
scale.tick_marks.minor.colorstring / objectthemeMinor tick colour
scale.tick_marks.minor.heightnumberMinor tick height in px
scale.tick_marks.minor.widthnumberMinor tick width in px
scale.labels.enabledbooleantrueShow scale value labels
scale.labels.show_unitbooleantrueAppend unit suffix to labels
scale.labels.unitstringentity unitOverride unit suffix on labels
scale.labels.colorstring / objectthemeLabel colour
scale.labels.font_sizenumberLabel font size in px
scale.labels.paddingnumberLabel padding in px
indicator.enabledboolean / stringtrueShow current value indicator. Also accepts a Jinja2/JS template resolving to a boolean for state-driven visibility, e.g. "{{ not is_state('sensor.x', 'unavailable') }}"
indicator.typestringlineline, round, or triangle
indicator.colorstring / objectthemeIndicator colour — state map supported
indicator.size.widthnumberIndicator width in px
indicator.size.heightnumberIndicator height in px
indicator.rotationnumber0Rotation angle in degrees (triangle type)
indicator.offset.xnumberHorizontal position offset in px
indicator.offset.ynumberVertical position offset in px
indicator.border.enabledbooleanShow indicator border
indicator.border.widthnumberIndicator border width in px
indicator.border.colorstring / objectIndicator border colour
marker_indicator.typestringtriangleDefault shape for value-marker range indicators
marker_indicator.alignstringcenterCross-axis alignment for markers: start, center, end
marker_indicator.size.widthnumber20Default marker width in px
marker_indicator.size.heightnumber20Default marker height in px
marker_indicator.rotationnumber180Default marker rotation in degrees
marker_indicator.offset.xnumberHorizontal offset in px
marker_indicator.offset.ynumberVertical offset in px
marker_indicator.colorstring / objectrange colourDefault marker colour
marker_indicator.border.enabledbooleanShow marker border
marker_indicator.border.widthnumberMarker border width in px
marker_indicator.border.colorstring / objectMarker border colour
yaml
style:
  track:
    type: gauge
    orientation: horizontal
    height: 48
    display:
      min: -20
      max: 45
      unit: "°C"
  gauge:
    color: "var(--lcards-blue)"
    progress_bar:
      layer: background
      align: middle
      radius: 4
      background:
        color: "var(--lcards-black-medium)"
    scale:
      tick_marks:
        major:
          interval: 10
          color: "var(--lcards-moonlight)"
          height: 12
          width: 2
        minor:
          interval: 5
          color: "var(--lcards-gray)"
          height: 6
          width: 1
      labels:
        enabled: true
        show_unit: true
        color: "var(--lcards-moonlight)"
        font_size: 10
    indicator:
      type: line
      color: "var(--lcards-orange)"

Value Tween

Eases the gauge fill, the current-value indicator, pills, and threshold/range markers between their old and new positions whenever the bound entity's state changes on its own — a genuine LCARS-style scroll/sweep instead of an instant snap. Only applies to entity-driven changes; dragging the slider directly stays instant (see Drag Value Badge for live feedback during the drag itself). Purely positional — it does not animate any text field's content (there's no "current value" text scroll/odometer effect; text fields, if configured, always show the correct value immediately).

yaml
value_tween:
  enabled: true      # default true. Forced off under the OS-level prefers-reduced-motion setting
  duration: 500       # ms, 0-5000, default 500
  ease: outQuad        # default outQuad
  targets:               # which elements animate — all default true
    track: true
    markers: true
FieldTypeDescription
enabledbooleanEnable value tweening (default true)
durationnumberTween duration in milliseconds, 0-5000 (default 500)
easestringAny anime.js v4 named easing that takes no extra parameters — linear, the in/out/inOut/outIn variants of Power/Quad/Cubic/Quart/Quint/Sine/Expo/Circ/Back/Elastic/Bounce, or spring (default outQuad)
targets.trackbooleanTween the card's primary value representation, whichever form the current track type gives it: the gauge/shaped fill plus its value indicator/needle, or the pills opacity sweep. A card is always in exactly one track type, so this single flag covers whichever one applies
targets.markersbooleanTween threshold/range marker position — including its label, if any, which moves in lockstep with the marker regardless of whether label.text is a static string or a template (only the label's position is animated, never its content). In pills mode this also governs which pill is highlighted as the marker sweeps. Applies to gauge and pills track types — shaped never renders markers at all

The slider editor's Value Animation section always shows track (its label switches between "Fill" and "Pills" to match the card's current track type) and hides markers only in shaped mode, which never renders them.

Zone/threshold colours are never tweened (they stay an instant, alert-like state change), and this has no effect while a component: shaped fill colour or range band colour changes — only positional/numeric elements animate.


Drag Value Badge

A floating badge that follows the drag position while you're actively dragging the slider — before the value is committed to the entity on release. Mirrors HA's native slider drag indicator. Works the same way across all three track types (pills, gauge, shaped): anchored below the track in horizontal orientation, and beside it in vertical — to the right for the default component, to the left for component: picard. It's never shown for entity-driven/external value changes — only for an actual user drag.

yaml
drag_badge:
  enabled: true
  format:
    decimals: 0          # blank = locale-default formatting
    show_unit: true
    unit: ""              # blank = use the track's display unit
  font_size: 14
  offset: { x: 0, y: 0 }
  color:
    default: "var(--lcars-text-light)"
  background:
    enabled: true
    color:
      default: "var(--lcars-blue)"
  border:
    enabled: true
    width: 1
    color:
      default: "var(--lcars-blue)"
  release:
    behavior: fade         # "fade" | "instant" — always instant under prefers-reduced-motion
    duration: 500            # ms, only used when behavior: fade
FieldTypeDefaultDescription
enabledbooleanfalseShow the badge while dragging
format.decimalsnumberlocale defaultFixed decimal places
format.show_unitbooleantrueShow the unit suffix
format.unitstringtrack display unitUnit override — blank uses style.track.display.unit / entity unit_of_measurement
font_sizenumber14Badge text size in pixels
offset.x / offset.ynumber0Pixel nudge from the default anchor point
colorstring / state-objecttheme text colourBadge text colour — supports state-based colours
background.enabledbooleantrueShow a background chip behind the text
background.colorstring / state-objecttheme-aware translucent surfaceBadge background colour
border.enabledbooleantrueShow a border around the badge
border.widthnumber1Border width in pixels
border.colorstring / state-objecttheme border colourBadge border colour
release.behaviorstringfadefade = linger briefly then fade out; instant = hide immediately on release. Always instant under the OS-level prefers-reduced-motion setting, regardless of this value
release.durationnumber500Fade-out duration in milliseconds (only used when release.behavior: fade)

Ranges

Define colour-coded value bands and point markers on the track. Two item types:

  • Band (min + max): coloured background zone
  • Marker (value): live point indicator that tracks a value, with an optional text label
yaml
style:
  ranges:
    - min: 0
      max: 20
      color: "var(--error-color)"
      opacity: 0.3
    - min: 20
      max: 80
      color: "var(--success-color)"
      opacity: 0.3
    - min: 80
      max: 100
      color: "var(--warning-color)"
      opacity: 0.3
    # Value marker — triangle at a live entity value, with a caption
    - value: "{entity.attributes.target_temp}"
      color: "var(--lcards-orange)"
      label:
        text: "Target"

min/max/value all support templates — but only the synchronous subset (JS, token, DataSource — no Jinja2), since these positions are resolved on every entity-state update. label.text supports the full template system, including Jinja2, since it's resolved separately and doesn't need to be synchronous.

Range band fields

FieldTypeDefaultDescription
minnumber / stringrequiredBand start value — supports templates: {entity.state}, {entity.attributes.x}, {states.domain.object_id.state}, {datasource:name}, {config.x}, {variables.x}, [[[JS]]]
maxnumber / stringrequiredBand end value — supports the same templates as min
colorstring / objectBand fill colour — state map supported
opacitynumber0.3Band opacity (0–1)

Value marker fields

FieldTypeDefaultDescription
valuenumber / stringrequiredPosition value — supports templates: {entity.state}, {entity.attributes.x}, {states.domain.object_id.state}, {datasource:name}, {config.x}, {variables.x}, [[[JS]]]
colorstring / objectMarker colour — state map supported
indicator.typestringtriangleShape: line, round, triangle
indicator.alignstringcenterCross-axis pin: start, center, end
indicator.colorstring / objectrange colourIndicator fill colour — overrides the range's own color for the indicator only
indicator.size.widthnumber20Width in px
indicator.size.heightnumber20Height in px
indicator.rotationnumber180Rotation in degrees
indicator.offset.xnumberHorizontal offset in px
indicator.offset.ynumberVertical offset in px
indicator.border.enabledbooleanShow border on indicator
indicator.border.colorstring / objectBorder colour
indicator.border.widthnumberBorder width in px
pill_style.strokebooleantruePills mode: outline on marker pill
pill_style.stroke_widthnumber2Pills mode: outline thickness in px
pill_style.stroke_colorstring/objectPills mode: outline colour. Falls back to the pill fill colour (color) if unset. Supports state-object syntax

Global marker defaults can be set at style.gauge.marker_indicator — individual range entries override per field.

Label fields

An optional text caption next to the marker (gauge mode) or highlighted pill (pills mode).

FieldTypeDefaultDescription
label.textstringLabel text. Nothing renders unless this is set. Supports all four template types, including Jinja2 and DataSource
label.colorstring / objecttheme defaultLabel text colour — state map supported
label.font_sizenumber14Font size in px — defaults to the gauge tick-label size
label.offset.xnumberHorizontal offset in px from the default position
label.offset.ynumberVertical offset in px from the default position

Default position (no offset set): above the marker in horizontal orientation, beside it in vertical orientation. There's no automatic collision avoidance against tick labels, the value readout, or other markers — use offset to manually clear overlaps, the same way indicator.offset already works for the marker shape itself.


Shaped Component

Use component: shaped for a solid fill clipped to a geometric shape.

yaml
type: custom:lcards-slider
entity: light.bedroom
component: shaped
style:
  shaped:
    type: lozenge       # lozenge | rect | rounded | diamond | hexagon | polygon | path
    fill:
      color: "var(--lcards-blue)"
    track:
      background: "var(--lcards-black-medium)"
    text_bands:
      top:
        size: 36
      bottom:
        size: 28
FieldTypeDefaultDescription
style.shaped.typestringlozengeShape: lozenge, rect, rounded, diamond, hexagon, polygon, path
style.shaped.radiusnumberautoCorner radius override in px
style.shaped.fill.colorstring / objectthemeFill colour for the active portion — state map supported
style.shaped.track.backgroundstring / objectthemeInterior background (empty portion) colour — state map supported
style.shaped.text_bands.top.sizenumber36Top text band height in px (vertical mode)
style.shaped.text_bands.bottom.sizenumber36Bottom text band height in px (vertical mode)
style.shaped.text_bands.left.sizenumber60Left text band width in px (horizontal mode)
style.shaped.text_bands.right.sizenumber60Right text band width in px (horizontal mode)
style.shaped.polygon.pointsarray[[xPct, yPct], ...] vertices (0–1) for polygon shape
style.shaped.path.dstringRaw SVG path d attribute (absolute coords)
style.shaped.path.translatebooleanfalseTranslate path to shape body origin

Picard Component

Use component: picard for the Picard-style gauge rendering — a decorative range frame, a dedicated solid value bar, and a scanning activity indicator alongside the standard gauge elements. Requires component: picard explicitly; presets like picard-gauge-vertical only declare compatibility, they don't set it for you.

yaml
type: custom:lcards-slider
entity: sensor.temperature
component: picard
preset: picard-gauge-vertical
style:
  range:
    border:
      color: "theme:components.slider.range.border.color"
    frame:
      color:
        active: "#00ffff"
        inactive: "#333333"
  solid_bar:
    color:
      active: "var(--lcards-green)"
      inactive: "var(--lcards-gray)"
  animation:
    indicator:
      color: "lighten(var(--lcards-orange), 0.2)"
FieldTypeDefaultDescription
style.range.border.colorstring / objectthemeRange track border colour — state map supported
style.range.frame.colorstring / objectrange border colourDecorative outline colour around the range track. Falls back to range.border.color if unset
style.solid_bar.colorstring / objectrange border colourSolid value-bar colour. Falls back to range.border.color if unset
style.animation.indicator.colorstring / objectthemeColour of the scanning/activity indicator shown during the built-in animation, if enabled on the preset

Text Labels

Sliders support the full text field system. See Text Fields for the complete reference.

yaml
text:
  default:
    font_family: "Antonio, sans-serif"
    color: "var(--lcards-moonlight)"
  label:
    content: Brightness
    position: top-left
    font_size: 11
  value:
    content: "[[[return Math.round(entity.attributes.brightness / 255 * 100) + '%']]]"
    position: top-right
    font_size: 11

style.border

The slider border is a per-side cap system — each side is configured independently. This differs from the button card border structure.

FieldTypeDescription
border.radiusnumber / string / objectUniform corner radius in px, a CSS variable string, or { top_left, top_right, bottom_right, bottom_left } per-corner
border.left.enabledbooleanEnable left border cap
border.left.sizenumberLeft border width in px
border.left.colorstring / objectLeft border colour — state map supported
border.right.enabledbooleanEnable right border cap
border.right.sizenumberRight border width in px
border.right.colorstring / objectRight border colour
border.top.enabledbooleanEnable top border cap
border.top.sizenumberTop border height in px
border.top.colorstring / objectTop border colour
border.bottom.enabledbooleanEnable bottom border cap
border.bottom.sizenumberBottom border height in px
border.bottom.colorstring / objectBottom border colour
yaml
style:
  border:
    radius: 8
    left:
      enabled: true
      size: 20
      color:
        default: "var(--lcards-gray)"
        active: "var(--lcards-orange)"
    right:
      enabled: false

Annotated Example

A climate thermostat slider with gauge style, tick marks, ranges, text labels, and a tap action:

yaml
type: custom:lcards-slider
entity: climate.living_room
preset: gauge-basic
control:
  attribute: temperature
  min: 15
  max: 30
  step: 0.5

text:
  default:
    font_family: "Antonio, sans-serif"
    color: "var(--lcards-moonlight)"
  label:
    content: Living Room
    position: top-left
    font_size: 11
    text_transform: uppercase
  value:
    content: "[[[return entity.attributes.current_temperature + '°C']]]"
    position: top-right
    font_size: 11

style:
  track:
    type: gauge
    orientation: horizontal
    height: 52
    display:
      min: 15
      max: 30
      unit: "°C"
  gauge:
    color:
      default: "var(--lcards-blue)"
      heat: "var(--lcards-alert-red)"
      cool: "var(--lcards-blue)"
    progress_bar:
      layer: background
      radius: 3
    scale:
      tick_marks:
        major:
          interval: 5
          color: "var(--lcards-moonlight)"
          height: 14
          width: 2
        minor:
          interval: 1
          color: "var(--lcards-gray)"
          height: 7
          width: 1
      labels:
        enabled: true
        show_unit: true
        color: "var(--lcards-moonlight)"
        font_size: 10
    indicator:
      type: triangle
      color: "var(--lcards-orange)"
  ranges:
    - min: 15
      max: 19
      color: "var(--lcards-blue)"
      opacity: 0.25
    - min: 19
      max: 24
      color: "var(--success-color)"
      opacity: 0.25
    - min: 24
      max: 30
      color: "var(--error-color)"
      opacity: 0.25
  border:
    radius: 8
    left:
      enabled: true
      size: 20
      color:
        default: "var(--lcards-gray)"
        active: "var(--lcards-orange)"

tap_action:
  action: more-info