Skip to main content

Badges

Purpose​

A flexible badge component that supports dot, number, or text badges, and can be positioned either inline or in the top-right corner of its children.

Import​

import MNBadge from '@/components/MNBadge';

Props​

PropTypeDefaultDescription
type'dot' | 'number' | 'text''dot'Type of badge to display
valuenumber | string-Value to display inside the badge (for number/text)
colorstringSECONDARY_COLORBackground color of the badge
position'topRight' | 'inline''topRight'Position of the badge relative to its children
childrenReact.ReactNode-The child elements to wrap with the badge
containerStyleViewStyle-Optional additional styles for the container view

Usage Examples​

Dot badge at top right​

<MNBadge>
<YourComponent/>
</MNBadge>

Number badge at top right with custom value and color​

<MNBadge type="number" value={5} color="#ff0000">
<YourComponent/>
</MNBadge>

Inline text badge​

<MNBadge type="text" value="New" position="inline" color="#00ff00">
<YourComponent/>
</MNBadge>

MNTextualBadge Component​

A simple textual badge component used to display small status or label information, supporting different visual types.


Import​

import MNTextualBadge from '@/components/MNTextualBadge';

Props​

PropTypeDefaultDescription
textstringRequiredThe text content displayed in the badge
type'primary' | 'info' | 'danger''primary'Style variant for the badge

Usage Examples​

Default (Primary) Badge​

<MNTextualBadge text="Active"/>

Info Badge​

<MNTextualBadge text="In Progress" type="info"/>

Danger Badge​

<MNTextualBadge text="Failed" type="danger"/>

NOTE: All example can be founded in badges.tsx