npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-mix-toast

v0.1.2

Published

react-native toast with animation for iOS & Android

Downloads

6

Readme

react-native-mix-toast 轻提示

npm package npm download license Stars

DESCRIBE

Android和iOS平台通用的自定义Toast UI组件

USAGE

INSTALL

npm install react-native-mix-toast

IMPORT

import Toast, { Duration, Position } from 'react-native-mix-toast';

EXAMPLE

Toast.show('This is Toast', {
    duration: Duration.LONG,
});

FUNC

show(content,{options})

显示Toast 属性 | 说明 | 类型 | 默认值 ----|-----|------|------ | content | Toast显示文本内容,可为React.Node | stringnode | - | | {options} | Toast显示参数API | object | - |

update(toast,content,{options})

更新Toast 属性 | 说明 | 类型 | 默认值 ----|-----|------|------ | toast | 需要更新的toast | object | - | | content | 同show() | stringnode | - | | {options} | 同show() | object | - |

hide(toast)

可以主动调用关闭Toast 属性 | 说明 | 类型 | 默认值 ----|-----|------|------ | toast | 需要更新的toast | object | - |

EXAMPLE

// show()
var myToast = Toast.show(
    'This is Toast', 
    { duration: Duration.PERSIST }
);
// update()
Toast.update(
    myToast,
    'This is Updated Toast',
    { duration: Duration.PERSIST }
);
// hide()
Toast.hide(myToast)

API

属性 | 说明 | 类型 ----|-----|------ | content | Toast显示文本内容,也可传入React.Node | stringnode | | options | Toast显示设置 | object |

OPTIONS

属性 | 说明 | 类型 | 默认值 ----|-----|------|------ | duration | 显示时间,默认提供LONG,SHORT,PERSIST | number | SHORT | | position | 显示位置,默认提供BOTTOM,TOP,CENTER | number | BOTTOM | | mask | 遮罩层 | bool | false | | icon | 显示图标 | numbernode | - | | opacity | 显示透明度 | number | 0.8 | | delay | 延时显示 | number | 0 | | animation | 渐入渐出动画,默认提供fade,slide-right,slide-left,slide-bottom,slide-top,scale,scale-vertical,scale-horizontal | string | fade | | custom | 完全自定义显示内容 | boolean | false | | keyboardAvoiding | 避免键盘遮挡 | boolean | true | | toastStyle| Toast自定义样式 | object | - | | textStyle | Toast文本自定义样式 | object | - | | iconStyle | Toast图标自定义样式 | object | - | | touchable | 可点击内容 | object | - | | hideOnPress | 点击取消显示 | boolean | fasle | | onPress | 点击Toast触发事件 | function | - | | onShow | 显示动画开始调用函数 | function | - | | onShown | 显示动画结束调用函数 | function | - | | onHide | 消失动画开始调用函数 | function | - | | onHidden | 消失动画结束调用函数 | function | - |

DEMO

cd demo
npm install
npm start

or

Expo