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.
light-toast
Advanced tools
Changelog
0.3.5
Readme
A light-weight React toast component with extremely easy API. Online Demo
yarn add light-toast
Version 0.2.0
and above require React hooks support, please use with caution.
import Toast from 'light-toast';
const Button = () => (
<button
onClick={() => {
Toast.info('message...', 3000, () => {
// do something after the toast disappears
});
}}
>
click me
</button>
);
Toast.info(content, duration, onClose);
Toast.success(content, duration, onClose);
Toast.fail(content, duration, onClose);
Toast.loading(content, onClose);
Toast.hide();
param | detail | type | default |
---|---|---|---|
content | toast message | string | |
duration | milliseconds delay to close | number | 3000 |
onClose | callback function after closing the toast | function |
If you use Toast.loading()
, you should call Toast.hide()
by yourself to close the toast,
since this often happens when you make an asynchronous request.
When you are in loading state, you can call Toast.info()
, Toast.success()
, Toast.fail()
directly to hide the loading message. This is useful when you want to hint something after waiting.
FAQs
A light-weight react toast component built for mobile web app
The npm package light-toast receives a total of 1,496 weekly downloads. As such, light-toast popularity was classified as popular.
We found that light-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.