Indicator

Display element at the corner of another element

Import

Usage

Color
Radius
Size
import { Indicator, Avatar } from '@mantine/core';

function Demo() {
  return (
    <Indicator>
      <Avatar size="lg" radius="sm" src="./avatar.png" />
    </Indicator>
  );
}

Inline

When the target element has a fixed width, set inline prop to add display: inline-block; styles to Indicator container. Alternatively, you can set width and height with style prop if you still want the 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="./avatar.png" />
    </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="./avatar.png" />
    </Indicator>
  );
}

Processing animation

import { Avatar, Indicator } from '@mantine/core';

function Demo() {
  return (
    <Indicator inline processing size={12}>
      <Avatar size="lg" radius="sm" src="./avatar.png" />
    </Indicator>
  );
}

Disabled

Set disabled to hide the indicator:

import { Avatar, Indicator } from '@mantine/core';

function Demo() {
  return (
    <Indicator inline disabled size={12}>
      <Avatar size="lg" src="./avatar.png" />
    </Indicator>
  );
}