DaisyUIComponents.Badge (DaisyUIComponents v0.8.3)

View Source

Badge component

https://daisyui.com/components/badge/

Summary

Functions

Renders a badge.

Returns the classes for a badge based on the provided parameters.

Functions

badge(assigns)

Renders a badge.

Examples

<.badge>Default</.badge>
<.badge primary class="gap-2">Primary</.badge>

Attributes

  • class (:string) - Defaults to nil.
  • color (:string) - Must be one of "neutral", "primary", "secondary", "accent", "info", "success", "warning", or "error".
  • ghost (:boolean) - Defaults to false.
  • outline (:boolean) - Defaults to false.
  • size (:string) - Must be one of "xs", "sm", "md", "lg", or "xl".
  • Global attributes are accepted.

Slots

  • inner_block

badge_classes(assigns)

Returns the classes for a badge based on the provided parameters.

Parameters

  • assigns - a map containing various options to customize the badge, including color, ghost, outline, size, and additional classes.

Description

Constructs a list of CSS classes for styling a badge.