tango-ui-cw
Version:
A lightweight ui library with ClayW
31 lines (26 loc) • 884 B
TypeScript
import type { CSSProperties, ReactNode } from "react";
import type { SxValue } from "../CSSFab";
export type NoticeType = "success" | "fail" | "caution";
export type NoticeVariant = "default" | "md";
export interface NoticeProps extends React.HTMLAttributes<HTMLDivElement> {
/** 通知类型 */
type?: NoticeType;
/** 图标(default 模式显示,md 模式隐藏) */
icon?: ReactNode;
/** 通知内容 */
message?: ReactNode;
/** 变体:default 顶部居中,md 左下角 */
variant?: NoticeVariant;
/** 自动关闭时间(ms),0 或不传则不自动关闭 */
duration?: number;
/** 关闭回调 */
onClose?: () => void;
/** 样式扩展 */
sx?: SxValue;
style?: CSSProperties;
className?: string;
}
declare const Notice: React.ForwardRefExoticComponent<
NoticeProps & React.RefAttributes<HTMLDivElement>
>;
export default Notice;