Knit UI
GitHub

Playground

Loading playground…

Playground
<Image
  src="https://picsum.photos/seed/knitui/400/300"
  alt="Sample image"
  width={400}
  height={300}
  fit="cover"
/>

Examples

Fit Modes

All object-fit values side by side; each image is constrained to the same box.

Loading example…

Fit ModesSourceStorybook

Radius

Border-radius applied via a raw CSS value — from sharp to fully rounded.

Loading example…

RadiusSourceStorybook

Fallback

When the primary src is broken, the image automatically shows fallbackSrc.

Loading example…

FallbackSourceStorybook

No Source

No src and no fallbackSrc — demonstrates empty / missing image handling.

Loading example…

No SourceSourceStorybook

Banner

Wide aspect ratio constrained to a fixed height — useful for banners.

Loading example…

BannerSourceStorybook

Avatar

Square thumbnail with a circular radius — common for avatars.

Loading example…

AvatarSourceStorybook

Deprecated Source

Demonstrates the deprecated source prop still resolves correctly.

Loading example…

Deprecated SourceSourceStorybook

Transition

expo-image cross-fades the image in once it loads. transition accepts a duration in ms (shown) or a full ImageTransition object ({ duration, effect, timing }).

Loading example…

TransitionSourceStorybook

Placeholder

A blurhash placeholder is shown while the full image loads, avoiding layout shift and blank space. placeholder also accepts a thumbhash or a low-res source.

Loading example…

PlaceholderSourceStorybook

Blurred

blurRadius applies a native blur to the rendered image.

Loading example…

BlurredSourceStorybook

Object Position

objectPosition (expo-image's contentPosition) controls how the image is aligned within its frame when it overflows.

Loading example…

Object PositionSourceStorybook

Radius Tokens

radius accepts the theme radius tokens (xxsxxl) in addition to raw CSS values. The image is clipped to the rounded frame on web and native alike.

Loading example…

Radius TokensSourceStorybook

Tinted

tintColor recolors the image — useful for monochrome icons/templates. It maps to expo-image's tintColor on native and an SVG color filter on web.

Loading example…

TintedSourceStorybook

Content Position Object

objectPosition (→ contentPosition) also accepts the object form with point/percent offsets from any edge.

Loading example…

Content Position ObjectSourceStorybook

Priorities

priority hints how urgently the image should load (low | normal | high). On web it sets fetchpriority on the underlying <img>.

Loading example…

PrioritiesSourceStorybook

Shadows

The inherited shadow elevation prop, from xs to xl.

Loading example…

ShadowsSourceStorybook

Styles

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

Loading example…

StylesSourceStorybook

Showcase

A feature showcase: rounded, animated cross-fade in, with a blurhash placeholder, memory-disk caching, and a recycling key.

Loading example…

ShowcaseSourceStorybook

Props

PropTypeDefaultDescription
disabled systemboolean | undefined
fallbackPropsPartial<ImageProps> | undefinedProps spread onto the backing image (alias for `styles.image`).
fallbackSrcstring | undefinedURL shown when the primary source fails to load.
fitImageObjectFit | undefined
cover · contain · fill · none · scale-down
"cover"CSS object-fit value. Defaults to "cover".
objectPositionImageObjectPosition | undefinedAlias for `contentPosition`.
onError((event: ImageErrorEvent) => void) | undefined
onLoad((event: ImageLoadEvent) => void) | undefined
radius systemstring | number | undefinedBorder-radius — a theme token key or any valid CSS value.
resizeModeImageHostResizeMode | undefinedDeprecated — use fit instead.
sourceImageSrc | undefinedDeprecated — use src instead.
srcImageSrc | undefinedhttps://picsum.photos/seed/knitui/400/300Image URL or require() result.
styles systemSlotStyles<ImageStyles> | undefinedPer-slot style sugar — props spread onto the matching part.
theme systemThemeName | null | undefinedApplies a theme to this element

Style slots

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

SlotUsage
fallbackstyles={{ fallback: { … } }}
imagestyles={{ image: { … } }}
overlaystyles={{ overlay: { … } }}
placeholderstyles={{ placeholder: { … } }}
rootstyles={{ root: { … } }}
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<unknown> | undefined

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