Badge
A short label for a status or a count, in semantic colors, with an icon or a remove cross, or a label over content.
import { Badge } from "@plexui/react-native"Examples
Overview
Labels over content
Brand badge
A brand draws a badge of its own (the day a task was done, on a capsule under a title) with tokens round it, over a soft accent pill badge: --badge-background, --badge-color, --badge-font-family (mono for the brand's mono face), --badge-font-weight, --badge-text-transform, --badge-letter-spacing, and each size's own --badge-size-md, --badge-font-size-md and --badge-gutter-md (sm, lg and xl alike).
Platforms
| iOS 26 | Android | |
|---|---|---|
| Native component | Badge | Badge |
| Look | The Plex label: a soft, solid or outline fill, or a counter | The same label, in the same tokens |
| Label over content | The quiet label in the tertiary system fill with a hairline rim; over a picture iOS 26's glass or clear glass | The same label; over a picture the glass of the bar circles, or a translucent gray |
Both platforms' own badges are a count or a dot on a tab or an icon (TabBar draws those); this Badge is the text label, drawn alike on both.
API
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Text, and an icon before it |
color | "secondary" | "accent" | "success" | "danger" | "warning" | "info" | "discovery" | "caution" | "secondary" | Semantic color |
variant | "soft" | "solid" | "outline" | "counter" | "label" | "soft" | Fill style: counter is a solid capsule, as an unread count; label a capsule, as a label over content |
size | "sm" | "md" | "lg" | "xl" | "sm"; a counter's and a label's "md" | Height: 20, 22, 24 or 36 points; a label 20, 24, 28 or 32 round a 12, 13, 15 or 17 label; a counter its count 11, 13, 15 or 17 (20.666 tall round 13) |
pill | boolean | false | Fully rounded, with a wider gutter |
onRemove | () => void | — | Adds a cross at the end of the badge that calls this when pressed |
removeLabel | string | "Remove" | Name of the cross for screen readers |
removable | boolean | false | Shows the cross as a mark, for a badge inside a control that takes the press |
mobileMaterial | "flat" | "glass" | "clear" | "flat" | A label over a picture: the platform's glass, or iOS's clear glass |
onPress | () => void | — | Makes the badge a button that leads somewhere, with a chevron after its label |
disclosure | boolean | true with onPress | The chevron of a pressable badge |
glint | { motion?: "sweep" | "orbit" | "spectrum"; color?: string; colors?: string[]; width?: number; length?: number; duration?: number; pause?: number; glow?: boolean } | boolean | false | A light on the outline: by default a sweep, a short slanted light crossing the badge in a second and again after a second's rest; `orbit`, a line going round over half the outline once in 8 seconds; `spectrum`, the whole outline in colors flowing round it once in 7.5 seconds (`colors` sets them). White on a label in glass, in the label's ink on any other badge; an object sets its motion, color, width at the middle (1), how much it covers (a sweep's width 0.3 of the badge's, an orbit's 0.5 of the outline), one pass in ms (1000 or 8000), the rest between sweeps (1000) and a glow inside the edge (off; a spectrum's line is 1.5 and its glow on); still with reduced motion |
weight | "regular" | "medium" | "semibold" | "bold" | — | The label's weight on every fill; without it a counter and a label are medium, the other fills semibold (or --badge-font-weight) |
textCase | "none" | "lowercase" | "uppercase" | "none" | The label's case, by the language's rules: lower case is centred optically, its x-height's middle on the badge's centre ((cap height - x-height) / 2 higher, about 1.1 at 13pt); capitals and words as given are centred by the capitals |
accessibilityLabel | string | — | A pressable badge's name for screen readers |
testID | string | — | Test id |
style | StyleProp<ViewStyle> | — | Style of the badge |