carbon-react
Version:
A library of reusable React components for easily building user interfaces.
32 lines (31 loc) • 1.56 kB
TypeScript
import React from "react";
import { MarginProps } from "styled-system";
import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
export type MessageVariant = "error" | "info" | "success" | "warning" | "neutral" | "ai" | "error-subtle" | "info-subtle" | "success-subtle" | "warning-subtle" | "ai-subtle" | "callout-subtle";
export type InternalMessageVariant = "error" | "info" | "success" | "warning" | "neutral" | "ai" | "callout";
export interface MessageProps extends MarginProps, TagProps {
/** Set the component's content */
children?: React.ReactNode;
/** Set custom aria-label for component's close button */
closeButtonAriaLabel?: string;
/** Set custom id to component root */
id?: string;
/** Callback triggered on dismiss */
onDismiss?: (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>) => void;
/** Flag to determine if the message is rendered */
open?: boolean;
/** @deprecated Flag to determine if the close button is rendered*/
showCloseIcon?: boolean;
/** Set message title */
title?: React.ReactNode;
/** @deprecated Set transparent styling */
transparent?: boolean;
/** Set the component's variant */
variant?: MessageVariant;
/** Set the component's width, accepts any valid css string */
width?: string;
/** Set the component's size */
size?: "medium" | "large";
}
export declare const Message: React.ForwardRefExoticComponent<MessageProps & React.RefAttributes<HTMLDivElement>>;
export default Message;