Skip to content

[Toolkit][DaisyUI] Add Badge recipe - #4377

Open
Enz000 wants to merge 1 commit into
symfony:3.xfrom
Enz000:toolkit-daisyui-badge
Open

Enz000 wants to merge 1 commit into
symfony:3.xfrom
Enz000:toolkit-daisyui-badge

Conversation

@Enz000

@Enz000 Enz000 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor
Q A
Bug fix? no
New feature? yes
Deprecations? no
Documentation? yes
Issues Part of #4247
License MIT

This adds the Badge recipe to the daisyui-5 kit.

The Badge component renders a <span> and maps the daisyUI classes to props:

<twig:Badge
    color="default | neutral | primary | secondary | accent | info | success | warning | error"
    variant="default | outline | dash | soft | ghost"
    size="xs | sm | md | lg | xl"
>
    Badge
</twig:Badge>

The props follow the Button recipe: color for the color, variant for the style and size for the size. The daisyUI examples use both <span> and <div>. The component always renders a <span>, which is valid inside a button or a heading, as in the "In A Button" and "In A Text" examples.

The README has every example of https://daisyui.com/components/badge/, plus an RTL example. The icons are inline SVG copied from the daisyUI docs, as in the Button recipe, so the recipe needs no icon package.

Screenshots

Example Light Dark
Sizes
Colors
Soft
Outline
Dash
Ghost
Empty
With icon
In a text
In a button
RTL

| Q              | A
| -------------- | ---
| Bug fix?       | no
| New feature?   | yes
| Deprecations?  | no
| Documentation? | yes
| Issues         | Part of symfony#4247
| License        | MIT

This adds the Badge recipe to the `daisyui-5` kit.

The Badge component renders a `<span>` and maps the daisyUI classes to props:

```twig
<twig:Badge
    color="default | neutral | primary | secondary | accent | info | success | warning | error"
    variant="default | outline | dash | soft | ghost"
    size="xs | sm | md | lg | xl"
>
    Badge
</twig:Badge>
```

The props follow the Button recipe: `color` for the color, `variant` for the style and `size` for the size. The daisyUI examples use both `<span>` and `<div>`. The component always renders a `<span>`, which is valid inside a button or a heading, as in the "In A Button" and "In A Text" examples.

The README has every example of https://daisyui.com/components/badge/, plus an RTL example. The icons are inline SVG copied from the daisyUI docs, as in the Button recipe, so the recipe needs no icon package.
@Enz000
Enz000 requested a review from Kocal as a code owner November 26, 2026 17:54
@carsonbot carsonbot added Documentation Improvements or additions to documentation Feature New Feature Toolkit Status: Needs Review Needs to be reviewed labels Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation Feature New Feature Status: Needs Review Needs to be reviewed Toolkit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants