infinity-ui-elements
Version:
A React TypeScript component library with Tailwind CSS design system
74 lines • 2.26 kB
TypeScript
import * as React from "react";
export interface ToastProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title" | "id"> {
/**
* Unique identifier for the toast
*/
id?: string;
/**
* Type of toast - determines behavior and styling
* - information: Auto-dismisses after duration, colored background (default position: bottom-center)
* - promotional: Stays until user dismisses, white background with more content (default position: bottom-right)
*/
type?: "information" | "promotional";
/**
* Intent/theme of the toast (only applicable for information type)
*/
intent?: "neutral" | "positive" | "negative" | "notice" | "info";
/**
* Position of the toast
* - information type default: bottom-center
* - promotional type default: bottom-right
*/
position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
/**
* Icon to display. If not provided, an icon will be automatically selected based on intent
*/
icon?: React.ReactNode;
/**
* Main message content (required for information type)
*/
message?: string;
/**
* Optional heading (primarily for promotional type)
*/
heading?: string;
/**
* Optional description (primarily for promotional type)
*/
description?: string;
/**
* Link text to display on the right
*/
linkText?: string;
/**
* Callback fired when the link is clicked
*/
onLinkClick?: () => void;
/**
* Button text (for promotional type)
*/
buttonText?: string;
/**
* Callback fired when the button is clicked
*/
onButtonClick?: () => void;
/**
* Callback fired when the close button is clicked
*/
onClose?: () => void;
/**
* Duration in milliseconds before auto-dismiss (only for information type)
* @default 5000
*/
duration?: number;
/**
* Whether to show the toast
*/
isVisible?: boolean;
/**
* Custom class name
*/
className?: string;
}
export declare const Toast: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<HTMLDivElement>>;
//# sourceMappingURL=Toast.d.ts.map