@coreui/react
Version:
UI Components Library for React.js
50 lines (49 loc) • 1.53 kB
TypeScript
import React, { HTMLAttributes } from 'react';
import type { Colors } from '../../types';
export interface CAlertProps extends HTMLAttributes<HTMLDivElement> {
/**
* Sets the `aria-label` of the dismissible close button.
*
* @since 5.13.0
*/
ariaCloseLabel?: string;
/**
* A string of all className you want applied to the 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;
/**
* Optionally add a close button to alert and allow it to self dismiss.
*/
dismissible?: boolean;
/**
* Callback fired when the component requests to be closed.
*/
onClose?: () => void;
/**
* Callback fired when the component has been closed and the CSS transition has completed.
*
* @since 5.13.0
*/
onClosed?: () => void;
/**
* Set whether the alert fades in and out when it is shown and hidden. Set to `false` to make it appear and disappear without a fade animation.
*
* @since 5.13.0
*/
transition?: boolean;
/**
* Set the alert variant to a solid.
*/
variant?: 'solid' | string;
/**
* Toggle the visibility of component.
*/
visible?: boolean;
}
export declare const CAlert: React.ForwardRefExoticComponent<CAlertProps & React.RefAttributes<HTMLDivElement>>;