Noora.Badge (noora v0.1.0-alpha.3)

Renders a customizable badge component with various styles, colors, sizes, and optional icons or status indicators.

Summary

Functions

badge(assigns)

Attributes

  • style (:string) - The style of the badge. Defaults to "fill". Must be one of "fill", or "light-fill".
  • label (:string) (required) - The label of the badge.
  • color (:string) - The color of the badge. Defaults to "neutral". Must be one of "neutral", "destructive", "warning", "attention", "success", "information", "focus", "primary", or "secondary".
  • size (:string) - The size of the badge. Defaults to "small". Must be one of "small", or "large".
  • disabled (:boolean) - Whether the badge is disabled. Overrides the color attribute. Defaults to false.
  • dot (:boolean) - Whether to render a dot on the side of the label. Defaults to false.
  • Global attributes are accepted.

Slots

  • icon - The icon to render next to the label. Overrides the dot attribute.

status_badge(assigns)

Attributes

  • type (:string) - Whether to render the prefix as a dot, or a status-specific icon. Defaults to "icon". Must be one of "icon", or "dot".
  • status (:string) (required) - The status of the badge. Must be one of "success", "error", "warning", "attention", or "disabled".
  • label (:string) (required) - The label of the badge.
  • Global attributes are accepted.

status_icon(assigns)