Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-native-tiny-toast
Advanced tools
Readme
A react native toast like component , it works on IOS and Android.
npm i react-native-tiny-toast --save
or
yarn add react-native-tiny-toast
import Toast from 'react-native-tiny-toast'
Toast.show('This is a default toast')
Toast.showSuccess('Pay success')
Toast.show('Custom toast',{
position: Toast.position.center,
containerStyle:{},
textStyle: {},
imgSource: require('xxx'),
imgStyle: {},
mask: true,
maskStyle:{},
...
})
const toast = Toast.showLoading('Loading...')
setTimeout(() => {
// Recommend
Toast.hide(toast)
// or Toast.hide()
// If you don't pass toast,it will hide the last toast by default.
}, 3000)
import React, {Component} from 'react-native'
import Toast from 'react-native-tiny-toast'
class Example extends Component {
state={
visible: false
}
componentDidMount() {
setTimeout(() => this.setState({
visible: true
}), 1000);
setTimeout(() => this.setState({
visible: false
}), 3000);
};
render() {
return
<Toast
visible={this.state.visible}
position={50}
onHidden={()=>{
// onHidden
}}>This is a message
</Toast>
}
}
Name | Default | Type | Description |
---|---|---|---|
containerStyle | null | ViewPropTypes.style | Custom container style |
duration | Toast.durations.SHORT | Number | Toast duration(ms), won't disappear if value is 0 |
delay | 0 | Number | The delay duration before toast start appearing on screen. |
animationDuration | 200 | Number | Animation duration |
visible | false | Boolean | Show toast. (Only for Toast Component) |
position | Toast.position.bottom | Number | 0 means the middle of the screen.A negative number indicates the distance to the bottom of the screen.A positive number indicates the distance to the top of the screen. |
animation | true | Boolean | Whether to enable fade animation |
shadow | false | Boolean | Whether to enable shadow |
shadowColor | #000 | String | Shadow color(don't support android) |
showText | true | Boolean | Whether to show text |
textColor | #fff | String | Text color |
textStyle | null | Text.propTypes.style | Text style |
mask | false(true when showLoading) | Boolean | Whether to enable mask |
maskColor | rgba(0,0,0,0.3) | String | Mask background color |
maskStyle | null | ViewPropTypes.style | Mask style |
imgSource | null | Image.source | Image source |
imgStyle | null | Image.propTypes.style | Image style |
loading | false(true when showLoading) | Boolean | Whether to show loading |
indicatorSize | large | String or Number | Set the ActivityIndicator size,Currently only specific values can be set on Android. |
onHidden | null | Function | Triggered when toast's hide animation end |
onMaskPress | null | Function | Triggered when the mask is clicked |
Method | Type | Description |
---|---|---|
show(text, options) | Function | Show a toast |
showSuccess(text, options) | Function | Show a toast with success icon |
showLoading(text, options) | Function | Show a toast with ActivityIndicator |
hide(toast) | Function | If you don't pass toast,it will hide the last toast by default. |
MIT Licensed
FAQs
😊A react native toast like component , it works on IOS and Android.
The npm package react-native-tiny-toast receives a total of 907 weekly downloads. As such, react-native-tiny-toast popularity was classified as not popular.
We found that react-native-tiny-toast demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.