RN Neo
Components

Badge

Small label for statuses, tags, and counts

A small label component for status indicators, tags, and counts. Defaults to a pill shape with a primary background, and automatically picks a readable text color based on the background.

Usage

import { Badge } from 'rn-neo';

// Plain text — no need to wrap in a Text component
<Badge>New</Badge>

// With a number
<Badge>4</Badge>

// Custom size and color
<Badge size="sm" backgroundColor="success">Active</Badge>

// Custom children
<Badge>
  <Icon name="star" size={12} />
</Badge>
If children is a string or number, Badge wraps it in the internal Text and picks the contrast color automatically via resolveColorFromBG — you never think about contrast. Any other child renders as-is, unwrapped.

Size

size controls padding and font size together. Default is md. Override padding directly with paddingHorizontal / paddingVertical if a preset doesn't fit.

SizePadding HPadding VFont Size
smsm (4px)xs (2px)sm (12px)
mdmd (8px)sm (4px)md (14px)
lglg (12px)md (8px)lg (16px)

Props

Badge

PropTypeDefaultDescription
size'sm' | 'md' | 'lg''md'Controls padding and font size together.
textStyleTextStyleStyle applied to the auto-rendered Text when children is a string or number.

Font

PropTypeDefaultDescription
textColorColors | stringAuto (from background)Text color. Resolved from background token if not set.
fontSizeFontSizeFrom sizeOverrides the font size from the size preset.
fontWeight'normal' | 'medium' | 'bold'Font weight token.
fontFamilystringCustom font family string.

Background

PropTypeDefaultDescription
backgroundColorBgColors | string'primary'Background color. Theme token or any color string.

Border

PropTypeDefaultDescription
borderbooleanFrom themeWhether to show a border.
borderSizeBorderSize | numberFrom themeBorder width. Token or raw number.
borderColorColors | stringFrom themeBorder color.
radiusRadius | number'full'Border radius. Defaults to a pill shape.

Shadow

PropTypeDefaultDescription
shadowbooleanFrom themeWhether to show a shadow.
shadowSizeShadowSize | numberFrom themeShadow offset size. Token or raw number.
shadowColorColors | stringFrom themeShadow color.

Spacing

Accepts all standard spacing props (padding*, margin*). See Box → Spacing for the full list.
Badge also accepts all standard React Native ViewProps (style, testID, accessible, …).

On this page