@metamask/snaps-sdk
Version:
A library containing the core functionality for building MetaMask Snaps
40 lines • 1.45 kB
text/typescript
import type { StandardFormattingElement } from "./formatting/index.cjs";
import type { IconElement } from "./Icon.cjs";
import type { ImageElement } from "./Image.cjs";
import type { LinkElement } from "./Link.cjs";
import type { TextElement } from "./Text.cjs";
export type TooltipChildren = TextElement | StandardFormattingElement | LinkElement | ImageElement | IconElement | boolean | null;
/**
* The props of the {@link Tooltip} component.
*
* @property children - The children of the box.
* @property content - The text to display in the tooltip.
*/
export type TooltipProps = {
children: TooltipChildren;
content: TextElement | StandardFormattingElement | LinkElement | IconElement | string;
};
/**
* A tooltip component, which is used to display text in a tooltip.
*
* @param props - The props of the component.
* @param props.children - The children of the tooltip.
* @param props.content - The text to display in the tooltip.
* @returns A tooltip element.
* @example
* <Tooltip content="Tooltip text">
* <Text>Hello world!</Text>
* </Tooltip>
* @example
* <Tooltip content={<Text>Text with <Bold>formatting</Bold></Text>}>
* <Text>Hello world!</Text>
* </Tooltip>
*/
export declare const Tooltip: import("../component.cjs").SnapComponent<TooltipProps, "Tooltip">;
/**
* A tooltip element.
*
* @see Tooltip
*/
export type TooltipElement = ReturnType<typeof Tooltip>;
//# sourceMappingURL=Tooltip.d.cts.map