Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rntoast

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rntoast

A light tip that can be used on both android and iOS.

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

RNToast

RNToast 功能类似于native-base的Toast,但是不同的是RNToast除了支持提示文字以外,还增加了图片的支持(android)。

如何使用

npm i rntoast --save

例子

import Toast from 'rntoast'

...
// other code
...

Toast.show({
            content: 'text', //也可以是一个自定义的组件
            duration: 2000,
            shadow: true,
            animation: false,
            hideOnPress: false,
            delayShow: 0,
            type: "info",
            confirm: true
          })

可用参数

NameTypeDefaultDescription
animationbooltrue组件显示/隐藏时是否有动态效果
confirmboolfalse是否显示Toast隐藏按钮
confirmTextstring'ok'Toast按钮的文字内容
containerStylestyle显示内容的整体样式
durationnumber3000Toast的持续时间
positionnumber正数距离顶部距离,负数距离底部距离, 0居中
opacitynumber1Toast的透明度
textStylestyle传入Toast中的内容为string时有效
delayShownumber0点击后延迟多久显示Toast
hideOnPressbooltrue点击Toast是否关闭Toast
typestringdefault支持success(#5cb85c)/info(#62B1F6)/error(#d9534f)/warning(#f0ad4e)/default(#999999)

可调用函数

NameTypeDefaultDescription
onHidefuncToast关闭前调用
onHiddenfuncToast关闭成功时调用
onShowfuncToast打开前调用
onShownfuncToast打开成功时调用

MIT Licensed

Keywords

FAQs

Package last updated on 15 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc