Indicator
Display element at the corner of another element
Import
Source
Docs
Package
Usage
Color
Radius
xs
sm
md
lg
xl
Inline
When target element has fixed width, set inline
prop to add display: inline-block;
styles to
Indicator container. Alternatively you can set width and height with sx
prop if you still want root
element to keep display: block
.
New
Offset
Set offset
to change indicator position. It is useful when Indicator component is
used with children that have border-radius:
Processing
Usage with numbers
If Indicator
label is a number, then you can use extra props to control how the label is displayed.
Overflow count
999
999
999
Show zero
Set showZero={false}
to hide indicator when label is 0
:
0
Indicator component props
Name | Type | Description |
---|---|---|
children * | ReactNode | Element that should have an indicator |
color | MantineColor | Color from theme.colors or any other valid CSS color value |
disabled | boolean | When component is disabled it renders children without indicator |
dot | boolean | |
inline | boolean | Determines whether indicator container should be an inline element |
label | ReactNode | Indicator label |
offset | number | Changes position offset, usually used when element has border-radius |
overflowCount | number | Indicator count overflowCount |
position | "bottom-end" | "bottom-start" | "top-end" | "top-start" | "bottom-center" | "top-center" | "middle-center" | "middle-end" | "middle-start" | Indicator position relative to child element |
processing | boolean | Indicator processing animation |
radius | number | "xs" | "sm" | "md" | "lg" | "xl" | border-radius from theme.radius or number value to set radius in px |
showZero | boolean | When showZero is true and label is zero renders children with indicator |
size | number | Size in px |
withBorder | boolean | Determines whether indicator should have border |
zIndex | ZIndex | Indicator z-index |
Indicator component Styles API
Name | Static selector | Description |
---|---|---|
root | .mantine-Indicator-root | Root element |
common | .mantine-Indicator-common | Indicator Common |
indicator | .mantine-Indicator-indicator | Indicator badge |
processing | .mantine-Indicator-processing | Indicator Processing |