PureAdmin.Components.KpiStrip (PureAdmin v1.2.0)

Copy Markdown View Source

KPI Numeric strip showcase — tabular spreadsheet-style table card.

Tracks _kpi-numeric-strip.scss from @keenmate/pure-admin-core 2.7.1+. Default 5-column layout (metric · now · prev · Δ% · target). Drop columns via no_previous_value / no_delta_percent / no_target_bar — toggles compose, so the visible column count ranges from 2 (all three optional columns dropped) to 5 (none dropped). The header row is auto-generated from the visible columns; override individual labels via header_labels, suppress via no_header, or fully replace via the :head slot.

Wide-only by design — no responsive collapse. Narrow placements should use kpi_gauge_list/1 instead.

Summary

Functions

kpi_strip(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.
  • no_previous_value (:boolean) - Drop the prev column (pa-kpi-strip--no-prev). Defaults to false.
  • no_delta_percent (:boolean) - Drop the Δ% column (pa-kpi-strip--no-delta). Defaults to false.
  • no_target_bar (:boolean) - Drop the target-bar column (pa-kpi-strip--no-target). Defaults to false.
  • no_header (:boolean) - Suppress the auto-generated header row. Defaults to false.
  • header_labels (:map) - Per-column header overrides — keys are :metric | :now | :previous_value | :delta_percent | :target_bar. Defaults to %{}.

  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • head - Fully replace the auto-generated header row with custom markup.
  • inner_block (required) - Row content — kpi_strip_row/1 instances.
  • footer

kpi_strip_row(assigns)

Renders one data row inside a kpi_strip/1.

The row is the hover host for the detail popover. Set detail_title_text plus any combination of previous_value_text / delta_absolute_text / target_text to auto-build the popover body. target_bar_percent drives the bar fill (visually capped at 100%); target_percent_text is the label below the bar (may exceed 100, e.g. "108%").

Attributes

  • id (:string) - Defaults to nil.
  • metric_text (:string) - Defaults to nil.
  • value_text (:string) - Defaults to nil.
  • unit_text (:string) - Defaults to nil.
  • prefix_text (:string) - Defaults to nil.
  • previous_value_text (:string) - Defaults to nil.
  • delta_text (:string) - Defaults to nil.
  • delta_variant (:string) - Defaults to nil.Must be one of nil, "positive", "negative", "neutral", "up_strong", or "down_strong".
  • target_bar_percent (:integer) - Bar fill width as a percentage (visually capped at 100). Defaults to nil.
  • target_percent_text (:string) - Label below the target bar — may exceed 100% (e.g. "108%"). Defaults to nil.
  • detail_title_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

  • metric
  • now
  • previous_value
  • delta
  • target
  • detail