Usage

Type an image packaged with the app.

tsx
// Type an image packaged with the app.
import { Image, type BundledImageSource } from 'kuito';
import cover from './assets/cover.png';

function Cover(props: { source: BundledImageSource }) {
  // An imported image knows its size, so the view keeps its aspect ratio.
  return (
    <Image src={props.source} width="100%" aspectRatio={props.source.width / props.source.height} />
  );
}

<Cover source={cover} />;

Type declaration

ts
export interface BundledImageSource {
  asset: string;
  width: number;
  height: number;
}

Members 3

NameTypeRequiredDescription
assetstringYes—
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.