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.

Referenz

Signaturen

ts
(props: ImageProps): KuitoElement

Parameter

NameTypErforderlichBeschreibung
propsImagePropsJa—

Rückgabe

KuitoElement

Props: ImageProps

Props (einschließlich geerbter Props) 96

NameTypErforderlichBeschreibung
onLoadStart(event: KuitoEvent<"loadstart">) => voidNein—
onLoad(event: ImageLoadEvent) => voidNein—
onError(event: ImageErrorEvent) => voidNein—
onLoadEnd(event: KuitoEvent<"loadend">) => voidNein—
idstringNein—
refElementRef<ElementHandle>Nein—
classProp<ClassNames>NeinClass names from a .css import or styles(): a string, or a list with falsy entries skipped, following the signals it reads.
styleStyleDeclarationsNeinStyles 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) => voidNein—
onPressCapture(event: PressEvent) => voidNein—
keystring | numberNein—
hiddenProp<boolean>NeinTakes the view out of layout and off screen, as CSS display: none.
paddingProp<LengthPercentage>Nein—
paddingTopProp<LengthPercentage>Nein—
paddingRightProp<LengthPercentage>Nein—
paddingBottomProp<LengthPercentage>Nein—
paddingLeftProp<LengthPercentage>Nein—
widthAnimatable<SizeValue>Nein—
heightAnimatable<SizeValue>Nein—
minWidthProp<SizeValue>Nein—
maxWidthProp<SizeValue>Nein—
minHeightProp<SizeValue>Nein—
maxHeightProp<SizeValue>Nein—
aspectRatioProp<number>NeinWidth divided by height; sizes the missing side from the other.
positionProp<"relative" | "absolute">Nein—
topProp<LengthPercentageAuto>Nein—
rightProp<LengthPercentageAuto>Nein—
bottomProp<LengthPercentageAuto>Nein—
leftProp<LengthPercentageAuto>Nein—
marginProp<LengthPercentageAuto>Nein—
marginTopProp<LengthPercentageAuto>Nein—
marginRightProp<LengthPercentageAuto>Nein—
marginBottomProp<LengthPercentageAuto>Nein—
marginLeftProp<LengthPercentageAuto>Nein—
flexGrowProp<number>Nein—
flexShrinkProp<number>Nein—
flexBasisProp<SizeValue | "content">Nein—
flexProp<number>NeinA grow factor from a zero basis, as CSS flex: n; 0 is inflexible.
alignSelfProp<"auto" | SelfAlignment>Nein—
directionProp<"ltr" | "rtl">NeinThe way lines run; unset, the parent's, and the app's first language's at the root.
boxSizingProp<"border-box" | "content-box">Nein—
paddingInlineStartProp<LengthPercentage>NeinPadding on the side lines start from: the left in ltr, the right in rtl.
paddingInlineEndProp<LengthPercentage>NeinPadding on the side lines end at: the right in ltr, the left in rtl.
marginInlineStartProp<LengthPercentageAuto>NeinMargin on the side lines start from: the left in ltr, the right in rtl.
marginInlineEndProp<LengthPercentageAuto>NeinMargin on the side lines end at: the right in ltr, the left in rtl.
insetInlineStartProp<LengthPercentageAuto>Neinleft in ltr, right in rtl.
insetInlineEndProp<LengthPercentageAuto>Neinright in ltr, left in rtl.
roleProp<Role>Nein—
onAction(event: AccessibilityActionEvent) => voidNeinThe screen reader action taken, by name.
accessibleProp<boolean>NeinMakes the view one screen reader element, read as its label or its children's text.
labelProp<string>NeinWhat a screen reader says for the view.
hintProp<string>NeinWhat happens when the view is activated, read after the label.
aria-hiddenProp<boolean>NeinScreen readers skip the view and its subtree.
actionsProp<readonly AccessibilityAction[]>NeinActions a screen reader offers; onAction receives the one taken.
liveProp<"off" | "polite" | "assertive">NeinARIA's aria-live: announces changes to the view's content, on iOS too.
aria-disabledProp<boolean>Nein—
aria-selectedProp<boolean>Nein—
aria-checkedProp<boolean | "mixed">Nein—
aria-busyProp<boolean>Nein—
aria-expandedProp<boolean>Nein—
aria-valueminProp<number>Nein—
aria-valuemaxProp<number>Nein—
aria-valuenowProp<number>Nein—
aria-valuetextProp<string>Nein—
gesturesreadonly Composable[]NeinThe view's gestures; several race unless composed with together or orElse.
opacityAnimatable<number>Nein—
backgroundColorAnimatable<string>Nein—
translateXAnimatable<number>Nein—
translateYAnimatable<number>Nein—
scaleAnimatable<number>Nein—
scaleXAnimatable<number>Nein—
scaleYAnimatable<number>Nein—
rotateAnimatable<number>NeinDegrees.
transitionPartial<Record<"opacity" | "backgroundColor" | "transform" | "borderRadius" | "borderColor" | "shadow" | "width" | "height" | "all", Animation<unknown> | AnimationSpec>>NeinHow the animatable props move when they change, enter or leave, by group; a CSS transition compiles to it.
animatePartial<Record<AnimatableProps, string | number>>NeinAnimatable props whose every change moves as transition says; the first value applies at once.
enterEffectNeinWhere the view enters from: fade.and(slide.up(12)).
exitProp<Effect>NeinWhere the view leaves to; it stays on screen until it is there. The renderer gets true, and keeps the view until exited.
layoutAnimation<number>NeinHow the view moves to a new frame the layout gives it: layout={spring()}.
borderRadiusAnimatable<number>Nein—
overflowProp<"visible" | "hidden" | "clip" | "scroll">Neinhidden and scroll clip; as in CSS, either lets a flex item shrink below its content.
borderWidthProp<number>Nein—
borderColorAnimatable<string>Nein—
shadowColorAnimatable<string>Nein—
shadowRadiusAnimatable<number>Nein—
shadowOffsetXAnimatable<number>Nein—
shadowOffsetYAnimatable<number>Nein—
backgroundGradient{ angle: number; colors: string[];}Nein—
colorProp<string>Nein—
sharedIdProp<string>NeinA 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>NeinA URL, or a bundled image as its import gives it.
objectFitProp<"none" | "cover" | "contain" | "fill">NeinCSS's object-fit: cover fills and crops, contain fits, fill distorts, none keeps its size, centered.
placeholderProp<string>NeinColor shown while the image loads.
fadeDurationProp<number>NeinCross-fade duration in milliseconds when the image appears; 0 by default.
tintColorProp<string>NeinRecolors the image's opaque pixels, for icons.
cacheProp<"none" | "memory-disk" | "memory" | "disk">NeinWhich caches may serve and keep the image; memory-disk by default.
thumbhashProp<string>NeinA ThumbHash of the image, in base64: its blurred preview shows, over placeholder, until the image loads.
onLoadStart — Methodensignaturen

Signaturen

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

Parameter

NameTypErforderlichBeschreibung
eventKuitoEvent<"loadstart">Ja—

Rückgabe

void

onLoad — Methodensignaturen

Signaturen

ts
(event: ImageLoadEvent): void

Parameter

NameTypErforderlichBeschreibung
eventImageLoadEventJa—

Rückgabe

void

onError — Methodensignaturen

Signaturen

ts
(event: ImageErrorEvent): void

Parameter

NameTypErforderlichBeschreibung
eventImageErrorEventJa—

Rückgabe

void

onLoadEnd — Methodensignaturen

Signaturen

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

Parameter

NameTypErforderlichBeschreibung
eventKuitoEvent<"loadend">Ja—

Rückgabe

void

onPress — Methodensignaturen

Signaturen

ts
(event: PressEvent): void

Parameter

NameTypErforderlichBeschreibung
eventPressEventJa—

Rückgabe

void

onPressCapture — Methodensignaturen

Signaturen

ts
(event: PressEvent): void

Parameter

NameTypErforderlichBeschreibung
eventPressEventJa—

Rückgabe

void

onAction — Methodensignaturen

Signaturen

ts
(event: AccessibilityActionEvent): void

Parameter

NameTypErforderlichBeschreibung
eventAccessibilityActionEventJa—

Rückgabe

void

backgroundGradient — verschachtelte Felder

backgroundGradient Felder

NameTypErforderlichBeschreibung
anglenumberJa—
colorsstring[]Ja—
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.