AccrueAdmin.Components.StatStrip (accrue_admin v1.5.0)

Copy Markdown View Source

Compact inline metric strip for list/index pages.

A quiet alternative to the KPI card band: renders a <dl> of label/value pairs in a single baseline-aligned row (hairline-separated, wrapping on narrow viewports). Use on list pages where the summary metrics should sit above the table without pushing it below the fold. The KPI card band (KpiCard) stays the treatment for the dashboard and detail-page summary rows.

Each :stat slot accepts label, value, an optional tone (moss | cobalt | amber) that colors the value only, and an optional href. When href is set the dt/dd stay as direct children of the .ax-stat grouping div and the link is rendered as a "stretched link" overlay (absolutely positioned to cover the whole .ax-stat) carrying an accessible name built from the label and value. The overlay <a> lives inside the <dd> rather than as a sibling of dt/dd: axe's definition-list rule flattens role-less grouping <div>s and flags any resulting non-dt/dd child, but does not recurse into dd, so nesting the link there keeps the <dl> structurally clean while preserving the overlay.

Summary

Functions

stat_strip(assigns)

Attributes

  • label (:string) (required)
  • component_group (:string) - Defaults to nil.

Slots

  • stat - Accepts attributes:
    • label (:string)
    • value (:string)
    • tone (:string)
    • href (:string)