Noora.Badge (noora v0.86.0)

Copy Markdown

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

Summary

Functions

badge(assigns)

Attributes

  • style (:string) - Controls whether the badge uses a solid or light fill. Defaults to "fill". Must be one of "fill", or "light-fill".
  • label (:string) (required) - Provides fallback text when the default slot is empty.
  • color (:string) - Controls the semantic color. Disabled badges ignore this value. Defaults to "neutral". Must be one of "neutral", "destructive", "warning", "attention", "success", "information", "focus", "primary", or "secondary".
  • size (:string) - Controls the badge dimensions and text size. Defaults to "small". Must be one of "small", or "large".
  • disabled (:boolean) - Uses the disabled presentation regardless of color. Defaults to false.
  • dot (:boolean) - Displays a dot before the label when the icon slot is empty. Defaults to false.
  • icon_only (:boolean) - Hides the label and displays only the icon slot. Defaults to false.
  • Global attributes are accepted.

Slots

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

badge_appearances()

badge_colors()

badge_sizes()

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", "disabled", or "in_progress".
  • label (:string) (required) - The label of the badge.
  • Global attributes are accepted.

status_icon(assigns)