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.
@baronha/ting
Advanced tools
Readme
🍞 Flexible and customizable React toast notifications with support for positioning, custom rendering, click handlers, and duration control.
Modal | ||
---|---|---|
yarn add @baronha/ting
or
npm i @baronha/ting
If you want to use Expo. Burnt is the solution for you.
cd ios && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --verbose
cd ios && pod install --verbose
import { toast } from '@baronha/ting';
// ...
const options = {
title: 'Done 😎',
message: 'Successful!!',
};
toast(options); // easy to use
import { toast } from '@baronha/ting';
// ...
const options = {
// ...
title: 'Vietnamese Gangz 😎',
message: 'Anh em tao là Vietnamese Gangz',
titleColor: '#D60A2E',
icon: {
uri: require('./vietnam.png'), // or remote
size: 24,
},
};
toast(options); // icon is 🇻🇳
import { alert } from '@baronha/ting';
// ...
const options = {
title: 'Done 😎',
message: 'Successful!!',
};
alert(options); // easy to use
Instead of using too many options like this:
const options = {
// ...
messageColor: '#D60A2E',
titleColor: '#D60A2E',
icon: {
uri: require('./vietnam.png'), // or remote
size: 24,
},
shouldDismissByTap: true,
position: 'bottom',
// ... bla bla bla
};
toast(options);
You want to initialize the default options for all subsequent use of toast or alert. You can use the setup function that is called when the application is initialized. Do the following:
import { setup } from '@baronha/ting';
const initOption = {
toast: {
messageColor: '#D60A2E',
titleColor: '#D60A2E',
backgroundColor: '#ffffff',
// ... more and more
},
alert: {
// ... alert's option
},
};
setup(initOption);
// Use it next time. You can completely override it on subsequent calls
toast({
title: 'Ting!',
message: 'Easy toast for React Native',
});
alert({
title: "What's up bruhhh!",
message: 'Easy Alert for React Native',
});
Property | Type | Default value | Platform | Toast | Alert | Description |
---|---|---|---|---|---|---|
title | string | null | ✅ | ✅ | ||
message | string | null | ✅ | ✅ | ||
titleColor | string | null | ✅ | ✅ | The color of the title text in hexadecimal format (e.g., #FF0000) | |
messageColor | string | null | ✅ | ✅ | The color of the message text in hexadecimal format (e.g., #00FF00) | |
icon | object | null | ✅ | ✅ | See Icon | |
preset | string | done | ✅ | ✅ | done, error, none, spinner | |
duration | number | 3 | ✅ | ✅ | The lifetime of the toast (seconds) | |
titleColor | string | null | ✅ | ✅ | ||
shouldDismissByDrag | boolean | true | ✅ | |||
position | string | top | ✅ | Toast is displayed from top or bottom | ||
haptic | string | null | ✅ | success, warning, error, none | ||
shouldDismissByTap | boolean | true | ✅ | |||
borderRadius | number | null | ✅ | |||
blurBackdrop | number | null | ✅ | |||
backdropOpacity | number | null | ✅ | |||
backgroundColor | string | #ffffff | ✅ | ✅ | The background color of the toast in hexadecimal format (e.g., #0000FF) |
icon | Type | Default value | Platform |
---|---|---|---|
uri | string | null | |
size | number | null | |
tintColor | string | null |
tintColor
for icon (v.1.0.5)backgroundColor
(v.1.0.3)spinner preset for toast
(v.1.1.0)#fff
, red
, rgba(0, 0, 0, .8)
)shouldDismissByDrag
on Androidcallback
We're trying to improve performance. If you have a better solution, please open a issue or pull request. Best regards!
See the contributing guide to learn how to contribute to the repository and the development workflow.
FAQs
test
The npm package @baronha/ting receives a total of 81 weekly downloads. As such, @baronha/ting popularity was classified as not popular.
We found that @baronha/ting demonstrated a healthy version release cadence and project activity because the last version was released less than 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.