Loading Strategy
Universal Card has two loading layers:
- inline lazy loading for regular body content
- modal
lazyorpreloadforbody_mode: modal
Modal loading strategy
modal:
loading_strategy: lazy
Supported values:
lazypreload
lazy
Use lazy when:
- modal content is heavy
- first-open speed is acceptable
- the dashboard runs on slower tablets or wall panels
preload
Use preload when:
- the modal is opened often
- first-open speed matters
- the content is relatively light
Inline lazy loading
These fields control regular body loading:
lazy_loadlazy_initial_batchlazy_batch_sizelazy_idle_timeoutskeleton_count
Example:
type: custom:universal-card
title: Inline lazy body
lazy_load: true
lazy_initial_batch: 1
lazy_batch_size: 2
lazy_idle_timeout: 120
skeleton_count: 2
body:
cards:
- type: entities
entities:
- sensor.demo_temperature
- type: entities
entities:
- sensor.demo_humidity
- type: entities
entities:
- sensor.network_health_sensor
Runtime-safety settings
Use these when the dashboard needs predictable behavior on weaker hardware:
stability_moderemember_expanded_stateremember_mode_stateenable_card_poolpool_scopepool_ttl_mspool_max_entries
Example combinations
Safe default modal
type: custom:universal-card
title: Safe modal
body_mode: modal
modal:
loading_strategy: lazy
body:
cards:
- type: entities
entities:
- light.kitchen
- light.hall
Fast first open
type: custom:universal-card
title: Quick controls
body_mode: modal
modal:
loading_strategy: preload
body:
cards:
- type: button
entity: light.kitchen
- type: button
entity: light.hall
Conservative dashboard tuning
type: custom:universal-card
title: Stable wall panel
lazy_load: true
lazy_initial_batch: 1
lazy_batch_size: 1
lazy_idle_timeout: 180
stability_mode: true
remember_expanded_state: false
enable_card_pool: true
pool_scope: card
pool_max_entries: 8
body:
cards:
- type: entities
entities:
- sensor.demo_temperature
- sensor.demo_humidity
- sensor.network_health_sensor
Recommendation
Start with defaults.
Only switch to preload or tune batching when you have a real performance or UX reason.