react-native-mtoast
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

React-Native-mToast

npm version

react native native toast

针对 react native 中 toast 无法覆盖 Modal 的问题,新增了此库解决上述问题。

Android 基于 GrenderG/Toasty

iOS 基于 scalessec/Toast

感谢 react-native-toasty

安装

npm i react-native-mtoast -E

使用

import Toast from "react-native-mtoast";

Toast.show(options: {
    /**
     * 消息内容
     */
    title: string;
    /**
     * 消息字体大小
     */
    titleSize?: number;
    /**
     * 消息字体颜色
     */
    titleColor?: string;
    /**
     * 显示时长
     * 0: SHORT; 1: LONG
     */
    duration?: 0 | 1;
    /**
     * 吐司背景色
     */
    tintColor?: string;
    /**
     * 显示位置
     */
    position?: 'top' | 'center' | 'bottom';
    /**
     * Android only
     */
    offsetX?: number;
    /**
     * Android only
     */
    offsetY?: number;
})

License

MIT

Package Sidebar

Install

npm i react-native-mtoast

Weekly Downloads

7

Version

1.2.0

License

MIT

Unpacked Size

24.8 kB

Total Files

15

Last publish

Collaborators

  • bashen1