PhoenixKitProjects.Web.Components.StatTile (PhoenixKitProjects v0.4.0)

Copy Markdown View Source

Compact bordered card with a label and a big number. Used in OverviewLive's top stats row (Running / Tasks in progress / Tasks todo / Tasks done) and in the bottom navigation row.

Named stat_tile to avoid colliding with core's fancier PhoenixKitWeb.Components.Core.StatCard.stat_card/1 (which takes title + subtitle + icon + color and renders a much larger card). This one is the minimum-chrome variant.

Example

<.stat_tile label="Running" value={@active_count} />
<.stat_tile label="Tasks in progress" value={@in_progress} value_class="text-warning" />

Summary

Functions

stat_tile(assigns)

Attributes

  • label (:string) (required)
  • value (:any) (required)
  • value_class (:string) - Defaults to nil.