Display a bundled, remote or local-file image. Use it for avatars, covers and photos returned by the picker or camera.

Load a cover without a blank flash

tsx
import { Image } from 'kuito';

export default function Cover() {
  return (
    <Image
      src="https://example.com/cover.jpg"
      width={160}
      aspectRatio={1}
      borderRadius={8}
      placeholder="#1e293b"
      fadeDuration={250}
    />
  );
}

Behavior

Give the image dimensions or an aspect ratio so layout can reserve space before download. placeholder fills the waiting area and fadeDuration controls its reveal. Remote images use native caching; image.prefetch warms the cache.

Props

Prop Meaning
src A URL string, { uri, headers? }, or an imported image (assets).
objectFit CSS's object-fit: cover (default), contain, fill or none.
tintColor Recolors opaque pixels, for icons.
onLoadStart / onLoadEnd Around every load, success or failure.
onLoad { width, height } of the image in pixels.
onError { error }, e.g. "HTTP 404".
aspectRatio (Kuito) Width ÷ height: sizes the view before the image arrives.
placeholder (Kuito) Color shown while loading.
thumbhash (Kuito) A base64 ThumbHash: its blurred preview shows while loading, over placeholder.
fadeDuration (Kuito) Cross-fade in milliseconds when the image appears; 0 by default.
cache (Kuito) memory-disk (default), memory, disk or none.

Continue

Read Assets for a complete workflow. See the complete prop reference for types and documented defaults.

Reference

Signatures

ts
(props: ImageProps): KuitoElement

Parameters

NameTypeRequiredDescription
propsImagePropsYes—

Returns

KuitoElement

Props: ImageProps

Props (including inherited props) 96

NameTypeRequiredDescription
onLoadStart(event: KuitoEvent<"loadstart">) => voidNo—
onLoad(event: ImageLoadEvent) => voidNo—
onError(event: ImageErrorEvent) => voidNo—
onLoadEnd(event: KuitoEvent<"loadend">) => voidNo—
idstringNo—
refElementRef<ElementHandle>No—
classProp<ClassNames>NoClass names from a .css import or styles(): a string, or a list with falsy entries skipped, following the signals it reads.
styleStyleDeclarationsNoStyles of this view alone, compiled at build time: CSS properties in camelCase. A value that changes must set a native prop (opacity).
onPress(event: PressEvent) => voidNo—
onPressCapture(event: PressEvent) => voidNo—
keystring | numberNo—
hiddenProp<boolean>NoTakes the view out of layout and off screen, as CSS display: none.
paddingProp<LengthPercentage>No—
paddingTopProp<LengthPercentage>No—
paddingRightProp<LengthPercentage>No—
paddingBottomProp<LengthPercentage>No—
paddingLeftProp<LengthPercentage>No—
widthAnimatable<SizeValue>No—
heightAnimatable<SizeValue>No—
minWidthProp<SizeValue>No—
maxWidthProp<SizeValue>No—
minHeightProp<SizeValue>No—
maxHeightProp<SizeValue>No—
aspectRatioProp<number>NoWidth divided by height; sizes the missing side from the other.
positionProp<"relative" | "absolute">No—
topProp<LengthPercentageAuto>No—
rightProp<LengthPercentageAuto>No—
bottomProp<LengthPercentageAuto>No—
leftProp<LengthPercentageAuto>No—
marginProp<LengthPercentageAuto>No—
marginTopProp<LengthPercentageAuto>No—
marginRightProp<LengthPercentageAuto>No—
marginBottomProp<LengthPercentageAuto>No—
marginLeftProp<LengthPercentageAuto>No—
flexGrowProp<number>No—
flexShrinkProp<number>No—
flexBasisProp<SizeValue | "content">No—
flexProp<number>NoA grow factor from a zero basis, as CSS flex: n; 0 is inflexible.
alignSelfProp<"auto" | SelfAlignment>No—
directionProp<"ltr" | "rtl">NoThe way lines run; unset, the parent's, and the app's first language's at the root.
boxSizingProp<"border-box" | "content-box">No—
paddingInlineStartProp<LengthPercentage>NoPadding on the side lines start from: the left in ltr, the right in rtl.
paddingInlineEndProp<LengthPercentage>NoPadding on the side lines end at: the right in ltr, the left in rtl.
marginInlineStartProp<LengthPercentageAuto>NoMargin on the side lines start from: the left in ltr, the right in rtl.
marginInlineEndProp<LengthPercentageAuto>NoMargin on the side lines end at: the right in ltr, the left in rtl.
insetInlineStartProp<LengthPercentageAuto>Noleft in ltr, right in rtl.
insetInlineEndProp<LengthPercentageAuto>Noright in ltr, left in rtl.
roleProp<Role>No—
onAction(event: AccessibilityActionEvent) => voidNoThe screen reader action taken, by name.
accessibleProp<boolean>NoMakes the view one screen reader element, read as its label or its children's text.
labelProp<string>NoWhat a screen reader says for the view.
hintProp<string>NoWhat happens when the view is activated, read after the label.
aria-hiddenProp<boolean>NoScreen readers skip the view and its subtree.
actionsProp<readonly AccessibilityAction[]>NoActions a screen reader offers; onAction receives the one taken.
liveProp<"off" | "polite" | "assertive">NoARIA's aria-live: announces changes to the view's content, on iOS too.
aria-disabledProp<boolean>No—
aria-selectedProp<boolean>No—
aria-checkedProp<boolean | "mixed">No—
aria-busyProp<boolean>No—
aria-expandedProp<boolean>No—
aria-valueminProp<number>No—
aria-valuemaxProp<number>No—
aria-valuenowProp<number>No—
aria-valuetextProp<string>No—
gesturesreadonly Composable[]NoThe view's gestures; several race unless composed with together or orElse.
opacityAnimatable<number>No—
backgroundColorAnimatable<string>No—
translateXAnimatable<number>No—
translateYAnimatable<number>No—
scaleAnimatable<number>No—
scaleXAnimatable<number>No—
scaleYAnimatable<number>No—
rotateAnimatable<number>NoDegrees.
transitionPartial<Record<"opacity" | "backgroundColor" | "transform" | "borderRadius" | "borderColor" | "shadow" | "width" | "height" | "all", Animation<unknown> | AnimationSpec>>NoHow the animatable props move when they change, enter or leave, by group; a CSS transition compiles to it.
animatePartial<Record<AnimatableProps, string | number>>NoAnimatable props whose every change moves as transition says; the first value applies at once.
enterEffectNoWhere the view enters from: fade.and(slide.up(12)).
exitProp<Effect>NoWhere the view leaves to; it stays on screen until it is there. The renderer gets true, and keeps the view until exited.
layoutAnimation<number>NoHow the view moves to a new frame the layout gives it: layout={spring()}.
borderRadiusAnimatable<number>No—
overflowProp<"visible" | "hidden" | "clip" | "scroll">Nohidden and scroll clip; as in CSS, either lets a flex item shrink below its content.
borderWidthProp<number>No—
borderColorAnimatable<string>No—
shadowColorAnimatable<string>No—
shadowRadiusAnimatable<number>No—
shadowOffsetXAnimatable<number>No—
shadowOffsetYAnimatable<number>No—
backgroundGradient{ angle: number; colors: string[];}No—
colorProp<string>No—
sharedIdProp<string>NoA view the navigation stack flies to the view with the same sharedId on the screen it pushes or pops to (docs/navigation.md#shared-elements).
srcProp<ImageSource>NoA URL, or a bundled image as its import gives it.
objectFitProp<"none" | "cover" | "contain" | "fill">NoCSS's object-fit: cover fills and crops, contain fits, fill distorts, none keeps its size, centered.
placeholderProp<string>NoColor shown while the image loads.
fadeDurationProp<number>NoCross-fade duration in milliseconds when the image appears; 0 by default.
tintColorProp<string>NoRecolors the image's opaque pixels, for icons.
cacheProp<"none" | "memory-disk" | "memory" | "disk">NoWhich caches may serve and keep the image; memory-disk by default.
thumbhashProp<string>NoA ThumbHash of the image, in base64: its blurred preview shows, over placeholder, until the image loads.
onLoadStart — method signatures

Signatures

ts
(event: KuitoEvent<"loadstart">): void

Parameters

NameTypeRequiredDescription
eventKuitoEvent<"loadstart">Yes—

Returns

void

onLoad — method signatures

Signatures

ts
(event: ImageLoadEvent): void

Parameters

NameTypeRequiredDescription
eventImageLoadEventYes—

Returns

void

onError — method signatures

Signatures

ts
(event: ImageErrorEvent): void

Parameters

NameTypeRequiredDescription
eventImageErrorEventYes—

Returns

void

onLoadEnd — method signatures

Signatures

ts
(event: KuitoEvent<"loadend">): void

Parameters

NameTypeRequiredDescription
eventKuitoEvent<"loadend">Yes—

Returns

void

onPress — method signatures

Signatures

ts
(event: PressEvent): void

Parameters

NameTypeRequiredDescription
eventPressEventYes—

Returns

void

onPressCapture — method signatures

Signatures

ts
(event: PressEvent): void

Parameters

NameTypeRequiredDescription
eventPressEventYes—

Returns

void

onAction — method signatures

Signatures

ts
(event: AccessibilityActionEvent): void

Parameters

NameTypeRequiredDescription
eventAccessibilityActionEventYes—

Returns

void

backgroundGradient — nested fields

backgroundGradient fields

NameTypeRequiredDescription
anglenumberYes—
colorsstring[]Yes—
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.