@cbinsights/fds
Version:
Form: A design system by CB Insights
26 lines (25 loc) • 1.03 kB
TypeScript
import React from 'react';
declare type ToastType = 'info' | 'warn' | 'error' | 'success' | 'progress';
export interface ToastProps {
/** JSX Content of Toast */
content?: React.ReactNode;
/** Type of toast */
type?: ToastType;
/** Label for action button */
actionLabel?: string;
/** Callback for action button click */
onAction?: React.MouseEventHandler<HTMLButtonElement>;
/** Time in ms to auto-dismiss toast */
dismissDelay?: number;
/** Should this toast auto-dismiss itself? */
isAutoDismiss?: boolean;
dismissOnAction?: boolean;
/** Is this toast user-dismissable? */
canDismiss?: boolean;
/** Number 1-100 declaring % progress */
progress?: number;
/** Passed by Toaster: function to dismiss the toast */
onDismiss?(...args: unknown[]): unknown;
}
declare const Toast: ({ isAutoDismiss, dismissDelay, canDismiss, dismissOnAction, type, content, actionLabel, progress, onAction, onDismiss, }: ToastProps) => JSX.Element;
export default Toast;