BundledImageSource
An image shipped inside the app, as importing a PNG or JPEG makes it, so an Image shows it with no request.
Verwendung
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} />;Typdeklaration
export interface BundledImageSource {
asset: string;
width: number;
height: number;
}Mitglieder 3
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
asset | string | Ja | — |
width | number | Ja | — |
height | number | 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.