Image

Displays files, URLs, encoded bytes or raw RGBA pixels.

Import

import { Image } from "@tarve/core";

Usage

Image.tsx
import { Image } from "@tarve/core";

<Image src="assets/photo.jpg" width={320} height={200} fit="cover" style={{ radius: 12 }} />

Props

PropTypeDefault
src required

Local path, data URL, encoded bytes, or raw RGBA8 pixels.

ImageSource—
fit "cover" | "contain"—
height number—
width number—

Common props

Shared by every component. See descriptions →

childrenhighlightidkeymotionFromonHighlightonPasteonTransitionEndrovingGroupstyle

Types

ImageSource
type ImageSource = string | Uint8Array | ImageBytesSource | ImageRgbaSource;