Knit UI
GitHub

Playground

Loading playground…

false
false
Playground
<Pill
  variant="default"
  size="sm"
  withRemoveButton={false}
  disabled={false}
>
  Pill
</Pill>

Examples

Variants

Both visual variants side by side at the default size.

Loading example…

VariantsSourceStorybook

Sizes

All seven sizes from xxs to xxl.

Loading example…

SizesSourceStorybook

Shadows

Each elevation of the inherited shadow prop applied to the pill.

Loading example…

ShadowsSourceStorybook

With Remove Button

Pill with a remove button — pressing × fires onRemove.

Loading example…

With Remove ButtonSourceStorybook

Disabled

Disabled state — reduced opacity, pointer events off.

Loading example…

DisabledSourceStorybook

Themed

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

Loading example…

ThemedSourceStorybook

Gradient

Gradient fill — themed default (no gradient prop), a two-color shorthand, a token gradient, and a multi-step stops gradient (shown with a remove button — the × glyph turns white).

Loading example…

GradientSourceStorybook

Gradient Presets

Curated gradient presets for the gradient variant.

Loading example…

Gradient PresetsSourceStorybook

Gradient Themed

Themed gradient (no gradient prop) — the $color5$color9 ramp follows the active theme.

Loading example…

Gradient ThemedSourceStorybook

Group

Pill.Group lays out pills in a wrapping row and propagates size/disabled to children.

Loading example…

GroupSourceStorybook

Removable Tags

A controlled tag-input pattern — click × to remove individual pills.

Loading example…

Removable TagsSourceStorybook

Styles

Per-slot styles targets individual parts — here the label and the removeButton.

Loading example…

StylesSourceStorybook

Matrix

Full variant × size matrix for visual regression.

Loading example…

MatrixSourceStorybook

Props

PropTypeDefaultDescription
childrenReactNodePillPill label.
disabled systemboolean | undefinedfalseReduced opacity and pointer events off.
gradient systemGradientValue | undefinedGradient fill for variant='gradient' — { from, to, deg } or { stops, deg }.
onRemove(() => void) | undefinedCalled when the remove button is pressed.
radius systemstring | number | undefined
removeButtonPropsPartial<CloseButtonProps> | undefinedProps for the remove button. Spread OVER the `removeButton` style slot, so an explicit `removeButtonProps` wins over `styles={{ removeButton }}`.
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
size system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
xxs · xs · sm · md · lg · xl · xxl
"sm" (or the enclosing `Pill.Group`'s size)Controls height, horizontal padding and font size.
styles systemSlotStyles<PillStyles> | 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 pill via the palette ramp.
variant systemPillVariant | undefined
default · contrast · gradient
"default"Visual style — default uses a subtle background, contrast uses the solid accent.
withRemoveButtonboolean | undefinedfalseShow a trailing remove (×) button.

Style slots

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

SlotUsage
labelstyles={{ label: { … } }}
removeButtonstyles={{ removeButton: { … } }}
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<TamaguiElement> | undefined

Plus 497 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.