Indicator

Display element at the corner of another element
Import

Usage

Color
Radius
xs
sm
md
lg
xl
import { Indicator, Avatar, Group } from '@mantine/core';
function Demo() {
return (
<Group position="center">
<Indicator>
<Avatar
size="lg"
src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=250&q=80"
/>
</Indicator>
</Group>
);
}

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
import { Avatar, Indicator } from '@mantine/core';
function Demo() {
return (
<Indicator inline label="New" size={16}>
<Avatar
size="lg"
src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=250&q=80"
/>
</Indicator>
);
}

Offset

Set offset to change indicator position. It is useful when Indicator component is used with children that have border-radius:

import { Avatar, Indicator } from '@mantine/core';
function Demo() {
return (
<Indicator inline size={16} offset={7} position="bottom-end" color="red" withBorder>
<Avatar
size="lg"
radius="xl"
src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=250&q=80"
/>
</Indicator>
);
}