react-native-modern-elements
Version:
A modern, customizable UI component library for React Native
25 lines (24 loc) • 1.11 kB
TypeScript
import React from "react";
import { StyleProp, TextStyle, ViewStyle } from "react-native";
export type ToastType = "success" | "error" | "info";
export type ToastAnimation = "fade" | "zoomIn" | "zoomOut" | "fromTop" | "fromBottom" | "center" | "leftToCenterCloseRight" | "rightToCenterCloseLeft" | "leftToCenterCloseLeft" | "rightToCenterCloseRight";
export type ToastRef = {
show: (message: string, type?: ToastType, animation?: ToastAnimation, duration?: number) => void;
};
export declare const toastRef: React.RefObject<ToastRef | null>;
interface ToastProps {
defaultAnimation?: ToastAnimation;
top?: number;
width?: number;
iconSize?: number;
iconColor?: string;
backgroundColors?: Partial<Record<ToastType, string>>;
textStyle?: StyleProp<TextStyle>;
contentStyle?: StyleProp<ViewStyle>;
duration?: number;
customIcons?: Partial<Record<ToastType, React.ReactNode>>;
maxHeight?: number;
containerStyle?: StyleProp<ViewStyle>;
}
declare const _default: React.NamedExoticComponent<ToastProps & React.RefAttributes<ToastRef>>;
export default _default;