React Native · Components
Badge
Small badge showing a status, label or count (same colors and sizes as web's Badge).
3 exports
Live example
The preview runs in the browser with the web component; the native component takes the same props and looks the same on iOS and Android.
Preview
New
Code
Events
- Events appear here when you interact with the preview.
Press effects (click or Space/Enter)
Corner shape
Style × color
neutralprimarydangersuccesswarning
neutralprimarydangersuccesswarning
neutralprimarydangersuccesswarning
Import
Badge
componentSmall badge showing a status, label or count (same colors and sizes as web's Badge).
Examples
BadgeVariant
typeBadge style (same as web).
BadgeProps
interfaceProps of Badge.
| Name | Type | Default | Description |
|---|---|---|---|
ref? | Ref<ViewRef> | Ref of the underlying native element. | |
children? | ReactNode | Text or number. | |
tone? | Tone | "neutral"` (or `appearance.defaults.badge.tone`) | Color. |
variant? | BadgeVariant | (string & {}) | "soft" | Variant: one of the built-in variants or a name added via appearance.variants.badge (the style's color field is the text color). |
effect? | EffectProp | Effect or effects ("shine", "pulse"…). Defaults to appearance.defaults.badge.effect. See BuiltinEffect. | |
tooltip? | TooltipProp | Tooltip shown on press and hold. See TooltipProp. | |
icon? | IconProp | Icon at the start of the text. | |
dot? | boolean | Puts a colored status dot before the text (e.g. "Online"). | |
size? | "sm" | "md" | "md"` (or `appearance.defaults.badge.size`) | Size. |
accessibilityLabel? | string | Screen reader label (if the content is not text). | |
style? | StyleProp<ViewStyle> | Container style. |