Knit UI
GitHub

Playground

Loading playground…

false
false
false
true
Playground
<Indicator
  position="top-end"
  size="xxs"
  withBorder={false}
  disabled={false}
  processing={false}
  showZero
/>

Examples

Positions

All nine anchor positions around the same target element.

Loading example…

PositionsSourceStorybook

Sizes

The seven named sizes resolve against the size token scale.

Loading example…

SizesSourceStorybook

With Label

Dot turns into a pill badge when a label is provided.

Loading example…

With LabelSourceStorybook

Max Value

Values exceeding maxValue are clamped and rendered as {maxValue}+.

Loading example…

Max ValueSourceStorybook

Disabled

disabled hides the dot while still rendering children.

Loading example…

DisabledSourceStorybook

Processing

processing animates the dot with a continuous opacity pulse plus a one-shot scale-in entrance. The pulse rides on the anchor wrapper while the entrance rides on the dot, so the two animation drivers never share a node (a bare dot, a label pill, and the size ladder all exercise that split — the path that crashed reanimated on native when both ran on one node).

Loading example…

ProcessingSourceStorybook

With Border

withBorder adds a ring in the page background so the dot separates from the target.

Loading example…

With BorderSourceStorybook

Show Zero

showZero controls whether a zero label is rendered or suppressed.

Loading example…

Show ZeroSourceStorybook

Shadows

The inherited shadow elevation prop, from xs to xl.

Loading example…

ShadowsSourceStorybook

Styles

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

Loading example…

StylesSourceStorybook

Themed

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

Loading example…

ThemedSourceStorybook

Props

PropTypeDefaultDescription
autoContrastboolean | undefined—Accepted for Mantine parity. Text already contrasts the accent fill via the ramp (`color1` on `color9`), so this is effectively always on.
disabled systemboolean | undefinedfalseHide the indicator while still rendering children.
labelReactNode—Content inside the indicator — turns the dot into a pill badge.
maxValuenumber | undefined—Numeric cap; values above it render as `{maxValue}+`.
offsetIndicatorOffset | IndicatorOffsetObject | undefined
0 · 0 · xxs · xs · sm · md · lg · xl · xxl
0Space-token or pixel nudge from the anchored edge(s).
positionIndicatorPosition | undefined
top-start · top-center · top-end · middle-start · middle-center · middle-end · bottom-start · bottom-center · bottom-end
'top-end'Corner / edge the indicator is anchored to.
processingboolean | undefinedfalseAnimate the dot with a continuous opacity pulse (plus a scale-in entrance).
radius systemstring | number | undefinedroundRounding of the dot/badge. Token, CSS value, or number.
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined——
showZeroboolean | undefinedtrueRender the indicator when the label is `0`.
size systemnumber | "xs" | "sm" | "md" | "lg" | "xl" | (string & {}) | "xxs" | "xxl" | undefined
xxs · xs · sm · md · lg · xl · xxl
'xxs'Dot/badge width and height; named values resolve against the size scale.
styles systemSlotStyles<IndicatorStyles> | undefined—Per-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 dot via the palette ramp.
withBorderboolean | undefinedfalseAdds a `background` ring so the dot separates from the target.
zIndexnumber | undefined1z-index of the indicator dot/badge.

Style slots

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

SlotTargets
dotProps spread onto the dot / pill badge (.Dot).
labelProps spread onto the label text inside the badge (.Label).
rootProps spread onto the container that wraps the children (.Frame).

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

Edit this page on GitHub