PureAdmin.Components.KpiHero (PureAdmin v1.2.0)

Copy Markdown View Source

KPI Hero + supporting showcase — headline metric + vertical rail of supporting tiles.

Tracks _kpi-hero-supporting.scss from @keenmate/pure-admin-core 2.7.1+. Default split is 1:1 (50/50). hero_split="2_3" gives the hero 2/3 of the width; hero_split="3_4" makes the rail a thin sidebar. Container query collapses to single column under 700px.

Summary

Functions

Renders the headline hero panel inside a kpi_hero_list/1.

Renders one supporting tile in the right-side rail.

Functions

kpi_hero_list(assigns)

Attributes

  • title_text (:string) - Defaults to nil.
  • is_live (:boolean) - Defaults to false.
  • live_text (:string) - Defaults to "LIVE".
  • footer_text (:string) - Defaults to nil.
  • hero_split (:string) - Defaults to nil.Must be one of nil, "2_3", or "3_4".
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required) - Hero content — typically a kpi_hero_main/1.
  • rail - Right-side rail content — typically multiple kpi_hero_side/1 tiles.
  • footer

kpi_hero_main(assigns)

Renders the headline hero panel inside a kpi_hero_list/1.

Attributes

  • id (:string) - Defaults to nil.
  • variant (:string) - Defaults to nil.Must be one of nil, "positive", "negative", "neutral", or "up_strong".
  • label_text (:string) - Defaults to nil.
  • value_text (:string) - Defaults to nil.
  • unit_text (:string) - Defaults to nil.
  • prefix_text (:string) - Defaults to nil.
  • delta_text (:string) - Defaults to nil.
  • period_text (:string) - Inline period label in the meta row (e.g. "vs last month"). Defaults to nil.
  • target_text (:string) - Inline target label in the meta row; also fed into the popover. Defaults to nil.
  • detail_title_text (:string) - Defaults to nil.
  • previous_value_text (:string) - Defaults to nil.
  • delta_absolute_text (:string) - Defaults to nil.
  • delta_absolute_sentiment (:atom) - Defaults to nil.Must be one of nil, :pos, :neg, or :warn.
  • detail_rows (:list) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • label
  • value
  • meta
  • chart
  • detail

kpi_hero_side(assigns)

Renders one supporting tile in the right-side rail.

Attributes

  • id (:string) - Defaults to nil.
  • variant (:string) - Defaults to nil.Must be one of nil, "positive", "negative", "neutral", or "up_strong".
  • label_text (:string) - Defaults to nil.
  • value_text (:string) - Defaults to nil.
  • unit_text (:string) - Defaults to nil.
  • prefix_text (:string) - Defaults to nil.
  • delta_text (:string) - Defaults to nil.
  • detail_title_text (:string) - Defaults to nil.
  • previous_value_text (:string) - Defaults to nil.
  • target_text (:string) - Defaults to nil.
  • delta_absolute_text (:string) - Defaults to nil.
  • delta_absolute_sentiment (:atom) - Defaults to nil.Must be one of nil, :pos, :neg, or :warn.
  • detail_rows (:list) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • label
  • value
  • delta
  • detail