ultra-design
Version:
44 lines (43 loc) • 1.25 kB
TypeScript
import React from 'react';
export interface ToastProps {
/**
*
* @description.zh-CN toast 内容
* @description.en-US toast content
*/
content?: React.ReactNode;
/**
* @description.zh-CN 自动关闭时长,默认 2000 ms
* @description.en-US leave duration, default 2000 ms
* @default '2000'
*/
duration?: number;
/**
* @description.zh-CN 关闭时触发的回调函数
* @description.en-US will be triggered when the toast is closed
*/
onClose?: () => void;
/**
* @description.zh-CN toast 相对浏览器窗口的 top 属性
* @description.en-US the top attribute of the toast relative to the browser window
* @default '20px'
*/
top?: string;
/**
* @description.zh-CN 隐藏手动关闭按钮
* @description.en-US hide close icon
* @default false
*/
hideClose?: boolean;
/**
* @description.zh-CN 自定义左侧 icon 图标
* @description.en-US custom left icon
*/
icon?: React.ReactNode;
}
declare const defaultProps: {
duration: number;
};
export declare type MergedToastrProps = typeof defaultProps & ToastProps;
declare const _default: React.FC<ToastProps>;
export default _default;