Skip to main content

Counter

Reusable Counter component

Example

import {
View,
} from '@lad-tech/mobydick-core';

export const BadgeWidget = () => {

return (
<View>
<Counter
size={ICounterSize.small}
type={ICounterTypes.accent}
count={1}
/>
<Counter type={ICounterTypes.attention} count={99} />
<Counter type={ICounterTypes.muted} count={999} />
<Counter type={ICounterTypes.accent} count={999} maxLength={3} />
</View>
);
};

Props

count

TYPE
number

Number for counter

type

TYPEDEFAULT
ICounterTypesICounterTypes.accent

Predefined type for counter

size

TYPEDEFAULT
ICounterSizeICounterSize.medium

Predefined size for counter

style

TYPE
ViewStyle

Custom styles for counter

maxLength

TYPEDEFAULT
number2

Maximum number length