UNPKG

retro-react

Version:

A React component library for building retro-style websites

55 lines (54 loc) 1.69 kB
/** @jsxImportSource theme-ui */ import { MouseEventHandler } from 'react'; import { ThemeUICSSObject } from 'theme-ui'; export declare type AlertColor = 'primary' | 'secondary' | 'success' | 'error' | 'warn'; export declare type AlertPosition = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'; export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> { /** * If open is passed, the Alert will show on the screen until the user closes it. * * @default undefined */ open?: boolean; /** * The position of the Alert. Only works if `open` is passed. * * @default 'bottom-left' */ position?: AlertPosition; /** * The color of the Alert. * * @default 'primary' */ color?: AlertColor; /** * The title of the Alert. * * @default '' */ title?: string; /** * Show close button. * * @default false */ showCloseButton?: boolean; /** * On close callback. * * @default undefined */ onClose?: MouseEventHandler<HTMLButtonElement>; sx?: ThemeUICSSObject; } /** * Alerts are used to communicate a state that affects a system, feature or page. * They should draw attention and provide a clear call to action. You can directly implement the Alert component or show it using the `open` prop through a state manager. * * @example * <Alert color="success" title="Success"> * Your account has been created. * </Alert> */ export declare const Alert: import("react").ForwardRefExoticComponent<AlertProps & import("react").RefAttributes<HTMLDivElement>>;