@metamask/snaps-sdk
Version:
A library containing the core functionality for building MetaMask Snaps
40 lines • 1.46 kB
text/typescript
import type { BorderRadius } from "./utils.mjs";
/**
* The props of the {@link Image} component.
*
* @property src - The SVG image to display. This should be an SVG string, and
* other formats such as PNG and JPEG are not supported directly. You can use
* the `data:` URL scheme to embed images inside the SVG.
* @property alt - The alternative text of the image, which describes the image
* for users who cannot see it.
*/
type ImageProps = {
src: string;
alt?: string | undefined;
borderRadius?: BorderRadius | undefined;
};
/**
* An image component, which is used to display an image.
*
* This component does not accept any children.
*
* @param props - The props of the component.
* @param props.src - The URL of the image to display. This should be an SVG
* string, and other formats such as PNG and JPEG are not supported directly.
* You can use the `data:` URL scheme to embed images inside the SVG.
* @param props.alt - The alternative text of the image, which describes the
* image for users who cannot see it.
* @param props.borderRadius - The border radius applied to the image.
* @returns An image element.
* @example
* <Image src="<svg>...</svg>" alt="An example image" />
*/
export declare const Image: import("../component.mjs").SnapComponent<ImageProps, "Image">;
/**
* An image element.
*
* @see Image
*/
export type ImageElement = ReturnType<typeof Image>;
export {};
//# sourceMappingURL=Image.d.mts.map