# Badge — React Native component for Expo

> Status pills in four styles that roll, pop and re-tint when their status changes.

Status labels in solid, soft, outline and dot styles across five tones — when the label changes it rolls over letter by letter, the icon pops, the colour cross-fades and the pill springs to its new width. Plus NotificationBadge with BadgeIconTile/BadgeIcon anchors (or your own children), spring-in counts, and pop on change.

- Docs: https://expokit.in/docs/components/badge
- Tier: Free
- Also called: notification badge, status badge, label tag
- Category: Display
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- npm dependencies: react-native-svg
- Uses ExpoKit items: kit
- Variants: Variants, Statuses, Live Status, Sizes, Notifications

## Installation

Run once per project: `npx @expokit/cli@latest init` (shared theme + KitProvider). Then:

```bash
npx @expokit/cli@latest add badge
```

The CLI copies the source into your project (you own the code) and installs react-native-svg.

Import: `import { Badge } from "@/components/ui/badge";`

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"solid" \| "soft" \| "outline" \| "dot"` | `"soft"` | Filled, tinted, bordered, or a neutral outline with a coloured leading dot. |
| `tone` | `"neutral" \| "accent" \| "success" \| "warning" \| "danger"` | `"neutral"` | Semantic colour. |
| `size` | `"sm" \| "md" \| "lg"` | `"md"` | 20 / 24 / 28pt tall. |
| `color` | `string` | — | Custom colour (overrides tone). |
| `icon` | `ReactNode` | — | Shown before the label. |
| `shape` | `"pill" \| "rounded"` | `"pill"` | Corner style. |
| `pulse` | `boolean` | `false` | Pulsing dot for live states (dot variant). |
| `animateChanges` | `boolean` | `true` | Roll the label, pop the icon, cross-fade colours and spring the width when they change. Never on mount. |
| `NotificationBadge.count` | `number` | `0` | Number shown; 0 hides it. |
| `NotificationBadge.showZero` | `boolean` | `false` | Keep the badge visible (showing 0) when count is 0. |
| `NotificationBadge.max` | `number` | `99` | Shows "99+" above this. |
| `NotificationBadge.dot` | `boolean` | `false` | Dot only, no number. |
| `NotificationBadge.children` | `ReactNode` | — | Element the badge is pinned to (top-right). |
| `NotificationBadge.offset` | `[number, number]` | `[0, 0]` | Nudge from the corner. |
| `style` | `StyleProp<ViewStyle>` | — | Style for the badge pill; NotificationBadge applies it to the anchor wrapper or bare bubble wrapper. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |

## Behaviour & accessibility

- **Motion**: On a change the old label rolls up and out as the new one rolls in (per letter for short Latin text), the icon swaps with a scale-and-rotate pop and the pill width springs to fit. Rolls and pops use the native driver; colour and width run on the JS driver on separate views. Nothing animates on mount; animateChanges={false} swaps instantly.
- **Reduced motion**: Changes swap instantly: no roll, pop, colour fade or width spring. The dot variant's pulse still loops.
- **Screen readers**: Text labels are one accessible element whose label is always the current text; on Android it is a polite live region so status changes are announced.
- **Platforms**: React Native Animated and react-native-svg only — iOS, Android, Expo Go and web.

## FAQ

### How do I make a notification badge in React Native?

Use ExpoKit's Badge: run npx @expokit/cli@latest add badge in your Expo or React Native project and it copies a ready-made notification badge into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.

### Does Badge work in Expo Go?

Yes. Badge runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg) are all included in Expo Go.

### How do I add Badge to my Expo app?

Run npx @expokit/cli@latest add badge in your project. The CLI copies the component's source into your app and installs react-native-svg, so the code is yours to change.

### Is Badge free?

Yes. Badge is free: its full source is on this page and the CLI installs it without an account.

### Can I change how Badge looks?

Yes. It takes its colours, radius and light / dark mode from useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.

## More

- Live preview, variants and code: https://expokit.in/docs/components/badge
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
