Shadix.Components.Badge (shadix v0.0.1)

Copy Markdown View Source

A badge styled with the shadcn variant system.

Renders a <span> carrying data-slot="badge" plus data-variant for stable styling/targeting. Caller-supplied class is appended last; Tailwind cascade layers ensure it wins over the defaults.

Summary

Functions

badge(assigns)

Attributes

  • variant (:string) - Defaults to "default". Must be one of "default", "secondary", "destructive", or "outline".
  • class (:string) - Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["title", "role"].

Slots

  • inner_block (required)