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: []
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

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)"

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
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
    - value: "{entity.attributes.target_temp}"
      color: "var(--lcards-orange)"

Range band fields

FieldTypeDefaultDescription
minnumber / stringrequiredBand start value — supports templates: {entity.attributes.x}, [[[JS]]]
maxnumber / stringrequiredBand end value — supports templates
colorstring / objectBand fill colour — state map supported
opacitynumber0.3Band opacity (0–1)

Value marker fields

FieldTypeDefaultDescription
valuenumber / stringrequiredPosition value — supports templates: {entity.attributes.x}, {states.id.state}, [[[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.


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