Knit UI
GitHub

Playground

Loading playground…

false
false
Playground
<Badge
  variant="light"
  size="md"
  circle={false}
  fullWidth={false}
>
  Badge
</Badge>

Examples

Variants

Every visual variant side by side, at the default size.

Loading example…

VariantsSourceStorybook

Sizes

The seven token sizes, from xxs to xxl, using the default light variant.

Loading example…

SizesSourceStorybook

Shadows

Elevation via the shared shadow ladder — inherited from Box, so every component accepts it; no shadow unless set.

Loading example…

ShadowsSourceStorybook

With Sections

Left and right sections hold icons or any adornment alongside the label.

Loading example…

With SectionsSourceStorybook

Circle

Circle mode — equal width and height for a single glyph or short number.

Loading example…

CircleSourceStorybook

Dot Variant

The dot variant prepends a colored indicator dot — no leftSection needed.

Loading example…

Dot VariantSourceStorybook

Themed

The palette ramp follows the active theme — same component, different accent.

Loading example…

ThemedSourceStorybook

Matrix

Full variant × size matrix for visual regression.

Loading example…

MatrixSourceStorybook

Gradient

The gradient variant fills the badge with a linear gradient. With no gradient prop it follows the theme ramp; otherwise it accepts a two-color shorthand, $colorN tokens, or a multi-step stops list. Text renders white.

Loading example…

GradientSourceStorybook

Gradient Presets

A set of curated multi-color gradient presets.

Loading example…

Gradient PresetsSourceStorybook

Gradient Themed

The themed gradient (no gradient prop) derives its ramp from the active theme.

Loading example…

Gradient ThemedSourceStorybook

Gradient Sizes

The Sunset gradient across the full token size scale.

Loading example…

Gradient SizesSourceStorybook

Styles

Per-slot styles targets individual parts — here the root frame and text label.

Loading example…

StylesSourceStorybook

Props

PropTypeDefaultDescription
disabled systemboolean | undefined
fullWidth systemboolean | undefinedfalseStretches the badge to the full width of its container.
gradient systemGradientValue | undefinedGradient fill for variant='gradient' — { from, to, deg } or { stops, deg }.
leftSectionReactNode
radius systemstring | number | undefined
unset · xs · sm · md · lg · xl · full
Border radius override — defaults to pill (999).
rightSectionReactNode
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
size systemnumber | "xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
xxs · xs · sm · md · lg · xl · xxl
mdControls height, horizontal padding and font size.
styles systemSlotStyles<BadgeStyles> | undefinedPer-slot style sugar — props spread onto the matching styled part.
theme systemThemeName | null | undefined
unset · blue · red · green · yellow · pink · gray
Active theme accent — recolors the badge via the palette ramp.
variant system"light" | "outline" | "white" | "transparent" | "default" | "dot" | "filled" | "gradient" | undefined
filled · light · outline · dot · transparent · white · default · gradient
lightVisual variant — how the theme color ramp is applied.

Style slots

Every part of Badge can be styled through the styles prop. Explicit props on the component always win over slot styles.

SlotUsage
dotstyles={{ dot: { … } }}
rootstyles={{ root: { … } }}
textstyles={{ text: { … } }}
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<TamaguiElement> | undefined

Plus 499 inherited style props from Box — the full Tamagui/React Native style surface, including token shorthands like p, mx, bg and c. See Tokens for the scales they accept, or the full list.