Usage

Read an image's dimensions before layout.

tsx
// Read an image's dimensions before layout.
import { Image, image, signal, type ImageSize } from 'kuito';

const natural = signal<ImageSize | null>(null);

image.prefetch('https://example.com/banner.jpg').then((size) => (natural.value = size));

<Image
  src="https://example.com/banner.jpg"
  width="100%"
  aspectRatio={natural.value ? natural.value.width / natural.value.height : 16 / 9}
/>;

Type declaration

ts
export type ImageSize = { width: number; height: number };

Members 2

NameTypeRequiredDescription
widthnumberYes—
heightnumberYes—
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.