Skip to main content

Indicator

Adds an indicator to wrapped elements.

Submit feedback
github
import { Indicator } from '@uhg-abyss/mobile';
    <Indicator>
    <Badge>Indicator Sandbox</Badge>
    </Indicator>

    Offset

    Use the offset prop to change the position of the Indicator. It is useful when the Indicator component is used with children that have border radius.

    Color

    Use the color prop to change the color of the Indicator. Default value is set to '$indicator.color.surface.container'.

    Label

    Use the label prop to add a label to the indicator. A value greater than 99 will display as "99+". Use the overflowCount prop to change the overflow value.

    Indicator Props

    Prop NameTypeDefaultDescription
    childrenReactNode-The contents of the indicator component
    colorstring$indicator.color.surface.containerColor of the indicator
    labelnumber | string-Label of the indicator
    offsetnumber0Change the indicator default position based on the position variant
    overflowCountnumber99Overflow count display
    position'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' 'top-end'Position of the indicator
    showZerobooleantrueFlag to hide label when value is 0

    Indicator Classes

    Class NameDescription
    abyss-indicatorIndicator element
    abyss-indicator-labelIndicator label element
    abyss-indicator-rootIndicator root element

    Indicator Tokens

    Token NameValue
    indicator.color.surface.container
    #990000
    indicator.color.border.container
    #FFFFFF
    indicator.color.text.label
    #FFFFFF
    indicator.border-radius.all.container
    500
    indicator.border-width.all.container.badge-count
    1
    indicator.border-width.all.container.alert-indicator
    2
    indicator.sizing.all.container.alert-indicator
    12
    indicator.sizing.width.min.container.badge-count
    20
    indicator.sizing.height.min.container.badge-count
    20
    indicator.spacing.padding.vertical.container.badge-count
    4
    indicator.spacing.padding.horizontal.container.badge-count
    6
    Table of Contents