Badge
Modifier | DaisyUI class |
---|---|
:neutral | badge-neutral |
:primary | badge-primary |
:secondary | badge-secondary |
:accent | badge-accent |
:ghost | badge-ghost |
:info | badge-info |
:success | badge-success |
:warning | badge-warning |
:error | badge-error |
:outline | badge-outline |
:lg | badge-lg |
:md | badge-md |
:sm | badge-sm |
:xs | badge-xs |
# Badge
1 Badge do 2"Badge"
3end
Badge
# Badge with brand colors
1 Badge do 2"default"
3end
4 5 Badge :neutral do 6"neutral"
7end
8 9 Badge :primary do 10"primary"
11end
12 13 Badge :secondary do 14"secondary"
15end
16 17 Badge :accent do 18"accent"
19end
20 21 Badge :ghost do 22"ghost"
23end
defaultneutralprimarysecondaryaccentghost
# Outline badge
1 Badge :outline do 2"default"
3end
4 5 Badge :primary, :outline do 6"primary"
7end
8 9 Badge :secondary, :outline do 10"secondary"
11end
12 13 Badge :accent, :outline do 14"accent"
15end
defaultprimarysecondaryaccent
# Badge sizes
1 Badge :lg do 2"987,654"
3end
4 5 Badge :md do 6"987,654"
7end
8 9 Badge :sm do 10"987,654"
11end
12 13 Badge :xs do 14"987,654"
15end
987,654987,654987,654987,654
# Empty badge
1 Badge :lg, :primary 2 Badge :md, :primary 3 Badge :sm, :primary 4 Badge :xs, :primary
# Badge with state colors
1 Badge :info, class: "gap-2" do 2x_svg
3 plain "info" 4end
5 6 Badge :success, class: "gap-2" do 7x_svg
8 plain "success" 9end
10 11 Badge :warning, class: "gap-2" do 12x_svg
13 plain "warning" 14end
15 16 Badge :error, class: "gap-2" do 17x_svg
18 plain "error" 19end
infosuccesswarningerror
# Badge in a text
1 h2 class: "text-xl" do 2 plain "Heading" 3 Badge :lg do 4"NEW"
5end
6end
7 8 h3 class: "text-lg" do 9 plain "Heading" 10 Badge :md do 11"NEW"
12end
13end
14 15 h4 class: "text-base" do 16 plain "Heading" 17 Badge :sm do 18"NEW"
19end
20end
21 22 h5 class: "text-sm" do 23 plain "Heading" 24 Badge :xs do 25"NEW"
26end
27end
HeadingNEW
HeadingNEW
HeadingNEW
HeadingNEW
# Badge in a button
1 Button do 2 plain "Inbox" 3 Badge do 4"+99"
5end
6end
7 8 Button do 9 plain "Inbox" 10 Badge :secondary do 11"+99"
12end
13end