@metamask/snaps-sdk
Version:
A library containing the core functionality for building MetaMask Snaps
43 lines • 1.59 kB
text/typescript
import type { ButtonElement } from "./form/Button.cjs";
import type { StandardFormattingElement } from "./formatting/index.cjs";
import type { IconElement } from "./Icon.cjs";
import type { LinkElement } from "./Link.cjs";
import type { SkeletonElement } from "./Skeleton.cjs";
import type { TextElement } from "./Text.cjs";
import { type SnapsChildren } from "../component.cjs";
/**
* Types of children components that can be used with Banner.
*/
export type BannerChildren = SnapsChildren<TextElement | StandardFormattingElement | LinkElement | IconElement | ButtonElement | SkeletonElement>;
/**
* The props of the {@link Banner} component.
*
* @param children - The content to display in the banner.
* @param title - Title of the banner.
* @param severity - Severity level of the banner.
*/
export type BannerProps = {
children: BannerChildren;
title: string;
severity: 'danger' | 'info' | 'success' | 'warning';
};
/**
* A Banner component, which is used to display custom banner alerts.
*
* @param props - The props of the component.
* @param props.children - The content to display in the banner.
* @param props.title - Title of the banner.
* @param props.severity - Severity level of the banner.
* @example
* <Banner title="Success banner" severity="success">
* <Text>Here is the banner content!</Text>
* </Banner>
*/
export declare const Banner: import("../component.cjs").SnapComponent<BannerProps, "Banner">;
/**
* A Banner element.
*
* @see Banner
*/
export type BannerElement = ReturnType<typeof Banner>;
//# sourceMappingURL=Banner.d.cts.map