DevactionUI.Badge (devaction_ui v0.1.0)

Copy Markdown View Source

Two small signals: count/1, the round bubble with a number (4 pull requests waiting), and dot/1, the status dot (connected, running). A dot can pulse, and stops under prefers-reduced-motion.

Summary

Functions

count(assigns)

Attributes

  • value (:integer) (required)
  • max (:integer) - above this the bubble reads 99+. Defaults to 99.
  • tone (:atom) - Defaults to :neutral. Must be one of :neutral, or :risk.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

dot(assigns)

Attributes

  • tone (:atom) - Defaults to :ok. Must be one of :ok, :warn, :risk, :info, or :neutral.
  • pulse (:boolean) - Defaults to false.
  • label (:string) - what the dot says, for assistive technology; without it the dot is decoration. Defaults to nil.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.