ShadcnUI.Components.Foundation.Badge (shadcn_ui v1.0.0)

Copy Markdown View Source

Compact passive labels with closed shadcn-style variants.

Badge renders one noninteractive span. Its text may communicate status, but selection, links, dismissal, lifecycle, and other behavior belong to the surrounding application markup.

Summary

Functions

Renders a passive inline badge.

Functions

badge(assigns)

Renders a passive inline badge.

Use an application-owned link or button when the content must navigate, activate, select, or dismiss. Badge deliberately rejects interactive globals instead of making a span imitate a control.

Attributes

  • variant (:atom) - Defaults to :default. Must be one of :default, :secondary, :destructive, or :outline.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)