Knit UI
GitHub

Playground

Loading playground…

true
Playground
<Avatar
  name="Jane Doe"
  variant="light"
  size="md"
  autoColor
/>

Examples

Variants

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

Loading example…

VariantsSourceStorybook

Sizes

The seven token sizes, from xxs to xxl.

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 Initials

Initials are derived from the name — one word gives up to two letters, two+ words give the first letter of each.

Loading example…

With InitialsSourceStorybook

Auto Color

Each avatar auto-selects a distinct accent color by hashing its name — no manual theme needed.

Loading example…

Auto ColorSourceStorybook

With Image

An image is rendered clipped to the avatar circle; if loading fails the initials placeholder is shown.

Loading example…

With ImageSourceStorybook

Custom Placeholder

Custom children are used as the placeholder instead of initials.

Loading example…

Custom PlaceholderSourceStorybook

Group

Avatar.Group stacks avatars with overlap; spacing controls the overlap distance in px.

Loading example…

GroupSourceStorybook

Matrix

Full variant × size matrix for visual regression.

Loading example…

MatrixSourceStorybook

Gradient

Gradient fills — the themed default ramp, a two-color shorthand, a token gradient, and a multi-step stops gradient.

Loading example…

GradientSourceStorybook

Gradient Presets

A handful of curated gradient presets — both two-color and multi-step.

Loading example…

Gradient PresetsSourceStorybook

Gradient Themed

With no gradient prop, variant="gradient" falls back to the active theme's ramp.

Loading example…

Gradient ThemedSourceStorybook

Gradient Sizes

A gradient fill across the seven token sizes.

Loading example…

Gradient SizesSourceStorybook

Gradient Group

Avatar.Group stacks gradient avatars — each with a distinct preset and initials.

Loading example…

Gradient GroupSourceStorybook

Styles

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

Loading example…

StylesSourceStorybook

Props

PropTypeDefaultDescription
allowedInitialsColorsreadonly string[] | undefinedSubset of accent colors eligible for auto-color assignment. Defaults to all available accent themes. Mirrors Mantine's `allowedInitialsColors`.
altstring | undefinedAccessible label for the avatar image role.
autoColorboolean | undefinedtrueAutomatically selects a theme accent by hashing the name when no explicit theme is set.
disabled systemboolean | undefined
gradient systemGradientValue | undefinedGradient fill for variant='gradient' — { from, to, deg } or { stops, deg }.
namestring | undefinedJane DoeUser name — rendered as initials when no image is present.
radius systemstring | number | undefined
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
size systemstring | number | undefined
xxs · xs · sm · md · lg · xl · xxl
mdControls the diameter and initials font size.
srcstring | null | undefinedImage URL. Falls back to initials or children on error.
styles systemSlotStyles<AvatarStyles> | undefinedPer-slot style sugar — props spread onto the matching styled part.
theme systemThemeName | null | undefined
unset · blue · red · green · orange · pink · purple · teal · yellow · gray
Explicit accent theme — overrides autoColor.
variant system"light" | "outline" | "white" | "transparent" | "default" | "filled" | "gradient" | undefined
filled · light · outline · transparent · default · white · gradient
lightVisual variant — how the theme color ramp is applied.

Style slots

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

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

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