base
"badge"
String
mod-badge
empty string
String
name
empty string
String
position
empty string
String
'top-right'
, 'top-left'
, 'bottom-right'
, 'bottom-left'
. If position is set to any of those values badge is positioned as absolute in the corner of the parent element (the parent element must be positioned as relative). If you need finer control over position see the example of positioned badge below.update-animation
empty string
String
'scale-up'
, 'bounce'
, 'to-danger'
and 'to-success'
update-key
undefined
String
Number
variant
empty string
String
mod-*
propsdefault
Badges can be placed above other elements with the use of few Tailwind classes. For example absolute top-0 right-0 -translate-y-1/2 translate-x-1/2
classes will put badge in the top right corner of the containg element. Position
prop can be also be used which is just shortcut to add these classes to badge automatically. However, if you need more control over placement use classes directly.
To animate badge once on value update use update-key
prop. For persistent animation you can use one of the Tailwind animate classes.