UNPKG

react-native-styled-toast

Version:

A theme friendly, easy to use react-native toast component built using styled-components and styled-system.

42 lines (41 loc) 1.46 kB
import * as React from 'react'; import { BoxProps } from '../Box'; import { StyledToastProps, TextProps } from './styles'; declare type IconFamilies = 'Entypo' | 'EvilIcons' | 'Feather' | 'FontAwesome' | 'FontAwesome5' | 'Foundation' | 'Ionicons' | 'MaterialCommunityIcons' | 'MaterialIcons' | 'Octicons' | 'SimpleLineIcons' | 'Zocial'; export declare type ToastConfig = { accentColor?: string; animationType?: 'slide' | 'scale' | 'fade'; bg?: string; closeButtonStyles?: BoxProps; closeIconColor?: string; closeIconFamily?: IconFamilies; closeIconName?: string; closeIconSize?: number; color?: string; duration?: number; hideAccent?: boolean; hideIcon?: boolean; iconColor?: string; iconFamily?: IconFamilies; iconName?: string; intent?: 'SUCCESS' | 'ERROR' | 'INFO'; message: string; onPress?: () => void; messageProps?: TextProps; subMessageProps?: TextProps; shouldVibrate?: boolean; subMessage?: string; toastStyles?: StyledToastProps; hideCloseIcon?: boolean; iconSize?: number; allowFontScaling?: boolean; }; export declare type ToastInternalConfig = { id?: string; index?: number; position?: 'TOP' | 'BOTTOM'; onClose?: (id: string) => void; }; export declare const Toast: React.FC<ToastConfig & ToastInternalConfig>; declare const _default: React.NamedExoticComponent<ToastConfig & ToastInternalConfig>; export default _default;