BundledImageSource
An image shipped inside the app, as importing a PNG or JPEG makes it, so an Image shows it with no request.
Usage
Type an image packaged with the app.
// 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
export interface BundledImageSource {
asset: string;
width: number;
height: number;
}Members 3
| Name | Type | Required | Description |
|---|---|---|---|
asset | string | Yes | — |
width | number | Yes | — |
height | number | Yes | — |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.