SlopUI.Components.Badge (SlopUI v0.1.0)

Copy Markdown View Source

Badges and status pills.

Summary

Functions

Renders a badge.

Functions

badge(assigns)

Renders a badge.

<.badge>Draft</.badge>
<.badge color="success" dot>Active</.badge>
<.badge variant="solid" color="danger">3</.badge>

Attributes

  • variant (:string) - Defaults to "soft". Must be one of "soft", "solid", or "outline".
  • color (:string) - Defaults to "neutral". Must be one of "neutral", "accent", "success", "warning", "danger", or "info".
  • size (:string) - Defaults to "md". Must be one of "sm", or "md".
  • dot (:boolean) - leading status dot. Defaults to false.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)