AuroraMeter.Components (Aurora Meter v0.3.0)

View Source

Drop-in HEEx components for showing live usage. Compiled only when Phoenix.Component is available (the LiveView deps are optional).

They are unstyled by design (BEM-style aurora-meter__* classes) so they inherit your app's look; the Pro dashboard ships a styled version. Pair with AuroraMeter.LiveView.subscribe/1 for live updates.

Summary

Functions

Renders a labelled usage bar for one feature, driven by AuroraMeter.quota/2.

Renders a usage meter for every feature in the tenant's plan.

Functions

usage_meter(assigns)

Renders a labelled usage bar for one feature, driven by AuroraMeter.quota/2.

Hard caps show used / limit; metered features show used / included and flag overage; boolean features show whether they are enabled.

Attributes

  • tenant (:any) (required)
  • feature (:atom) (required)
  • label (:string) - Defaults to nil.
  • Global attributes are accepted.

usage_summary(assigns)

Renders a usage meter for every feature in the tenant's plan.

Attributes

  • tenant (:any) (required)
  • Global attributes are accepted.