<Badge>
Component
<Badge>
represents counters or labels.
Here the demo:
<Badge>
Component<Badge>
represents counters or labels.
Here the demo:
<Badge>
ComponentThere are 2 ways to install <Badge>
component into your react app project:
expanded
PropertyExpands/Collapses the <Badge>
.
The possible values are:
undefined
true
false
Here the preview:
<Badge expanded={true}>
lazy
PropertyDetermines whenever the <Badge>
's children
should be rendered or not when the <Badge expanded={false}>
.
The possible values are:
undefined
false
true
Determines how the <Badge>
should be floating on the target DOM reference.
floatingOn
PropertyDetermines the target DOM reference where the <Badge>
should be floating on.
If not set (undefined
), the <Badge>
becomes a normal element flow.
Here the preview:
floatingPlacement
PropertyDetermines the location where the <Badge>
should be floating on the target DOM reference.
Here the preview:
floatingPlacement='top'
floatingStrategy
PropertyDetermines the technical strategy how the <Badge>
can float.
In most cases, you should not worry about the detail mechanism how the <Badge>
can float.
The possible values are:
undefined
'absolute'
'fixed'
floatingAutoFlip
PropertyAutomatically flips the floatingPlacement
to opposite direction when the <Badge>
is about to be clipped.
The possible values are:
undefined
true
false
Here the preview:
floatingAutoShift
PropertyAutomatically shifts the floatingPlacement
to nearest safe position when the <Badge>
is about to be clipped.
The possible values are:
undefined
true
false
Here the preview:
floatingOffset
PropertyThe distance (in pixel) between the <Badge>
and the target DOM reference.
The possible values are:
undefined
0
Here the preview:
<Badge floatingOffset={0}>
floatingShift
PropertyThe distance (in pixel) between the <Badge>
and the default floatingPlacement
location.
The possible values are:
undefined
0
Here the preview:
<Badge floatingShift={0}>
onFloatingUpdate
PropertySets a callback function to be called when the <Badge>
updates the position relative to the target DOM reference.
The callback function parameters:
event: FloatingPosition
The alternative appearances of the <Badge>
layout without changing the <Badge>
's functionality.
badgeStyle
PropertySets the alternative appearances of the <Badge>
.
The possible values are:
undefined
'regular'
'pill'
'square'
'circle'
Here the preview:
size
PropertyDefines the alternative size of the <Badge>
.
The possible values are:
undefined
'sm'
'md'
'lg'
Here the preview:
theme
PropertyDefines the contextual theme of the <Badge>
.
The possible values are:
undefined
'primary'
'secondary'
'success'
'info'
'warning'
'danger'
'light'
'dark'
Here the preview:
gradient
PropertyActivates a 3D mode of the <Badge>
.
The possible values are:
undefined
'inherit'
true
false
Here the preview:
outlined
PropertyActivates an outlined mode (background-less, contrast foreground, and contrast border) of the <Badge>
.
The possible values are:
undefined
'inherit'
true
false
Here the preview:
mild
PropertyActivates a mild mode (mild background, contrast foreground, and contrast border) of the <Badge>
.
The possible values are:
undefined
'inherit'
true
false
Here the preview:
nude
PropertyActivates an nude mode (background-less, padding-less, and border-less) of the <Badge>
.
The possible values are:
undefined
true
false
Here the preview:
Because <Badge>
is made from <Popup>
, so all properties from <Popup>
are inherited.
There are several variables of <Badge>
you can customize. Changing the variables affects all <Badge>
instance and other components that depend on <Badge>
.
Here the exposed variables:
The example of accessing, modifying, & adding variables: