UNPKG

@coreui/react-pro

Version:

UI Components Library for React.js

54 lines (53 loc) 1.53 kB
import React, { HTMLAttributes } from 'react'; import type { Colors } from '../../types'; export interface CToastProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> { /** * Apply a CSS fade transition to the toast. */ animation?: boolean; /** * Auto hide the toast. */ autohide?: boolean; /** * A string of all className you want applied to the base component. */ className?: string; /** * Sets the color context of the component to one of CoreUI’s themed colors. * * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string */ color?: Colors; /** * Delay hiding the toast (ms). */ delay?: number; /** * @ignore */ index?: number; /** * @ignore */ innerKey?: number | string; /** * Callback fired when the component requests to be closed. */ onClose?: (index: number | null) => void; /** * Callback fired when the component requests to be shown. */ onShow?: (index: number | null) => void; /** * Toggle the visibility of component. */ visible?: boolean; } interface ContextProps extends CToastProps { visible?: boolean; setVisible: React.Dispatch<React.SetStateAction<boolean | undefined>>; } export declare const CToastContext: React.Context<ContextProps>; export declare const CToast: React.ForwardRefExoticComponent<CToastProps & React.RefAttributes<HTMLDivElement>>; export {};