components
Tailwind CSS
Badge Badges serve to communicate the status of particular data to the user.
The standard format for badge is component class badge
, accompanied by modifier class badge-{semantic-color}
.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Default
Neutral
Primary
Secondary
Accent
Info
Success
Warning
Error
Add modifier class badge-soft
for soft colored badges.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Default
Neutral
Primary
Secondary
Accent
Info
Success
Warning
Error
Add modifier class badge-outline
for outline badges.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Default
Neutral
Primary
Secondary
Accent
Info
Success
Warning
Error
Use the rounded-full
utility class to make badges pilled. The default shape of the badges but can be altered by using
TailwindCSS Border Radius utility classes.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
This is the Default shape of the badge.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Add responsive class badge-{size}
where {size} = xs|sm|default|lg|xl
for badges of different sizes.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Use badges in anchor tags for clickable badge links.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Use badge with utility classes height(h)
, width(w)
or size
& p-0
for dot style badges.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Neutral
Primary
Secondary
Success
Error
Warning
Info
Use svg
or icons
inside badges for icon badges.
Add utility classes size
& p-0
for square icon badges.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Add utility classes rounded-full
, size
& p-0
for circular Icon badges.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Badges used in text inherit
the font size of the immediate parent element.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Heading NEW
Heading NEW
Heading NEW
Heading NEW
Heading NEW
Add badges to buttons to display additional information in buttons.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Use the img
tag to display avatar badges with an image.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
Required FlyonUI JS Dismissible badges are also referred as chips.
Include the data-remove-element
attribute in the close button element and set its value to #id
to specify the element to be removed. Customize the removal animation by incorporating the removing:
modifier, as illustrated below.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">
A simple example of dismissible avatar badges.
Copy
toggleRTL($refs.previewFrame), 100);
}" class="size-9.5 border-neutral/10 rounded-btn text-base-content hover:bg-neutral/[0.03] flex items-center justify-center gap-2 border max-sm:hidden">