Skip to content
/ ting Public
forked from baronha/ting

🍞 Flexible and customizable React Native toast/alert notifications with support for positioning, custom rendering, click handlers, and duration control. Written in Swift and Kotlin

License

Notifications You must be signed in to change notification settings

Acetyld/ting

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

54 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Logo1.0.3 BuyMeACoffee Kofi

Overview

Turbo Native Modules Swift Kotlin

Ting - React Native Toast | Product Hunt

🍞 Flexible and customizable React toast notifications with support for positioning, custom rendering, click handlers, and duration control.

Video Demo πŸ“Ί

ios android Modal
Ting_iOS.mp4
Ting_Android.mp4
Modal.mp4

Installation

yarn add @baronha/ting
or
npm i @baronha/ting

If you want to use Expo. Burnt is the solution for you.

iOS

New Architecture

cd ios && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --verbose

Older

cd ios && pod install --verbose

Usage

Toast

import { toast } from '@baronha/ting';
// ...
const options = {
  title: 'Done 😎',
  message: 'Successful!!',
};

toast(options); // easy to use

Customize Icon

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 πŸ‡»πŸ‡³

Alert

import { alert } from '@baronha/ting';
// ...
const options = {
  title: 'Done 😎',
  message: 'Successful!!',
};

alert(options); // easy to use

Options

Property Type Default value Platform Toast Alert Description
title string null Both βœ… βœ…
message string null Both βœ… βœ…
titleColor string null Both βœ… βœ…
messageColor string null Both βœ… βœ…
icon object null Both βœ… βœ… See Icon
preset string done Both βœ… βœ… Toast: done, error, none.
Alert: done, error, none, spinner
duration number 3 Both βœ… βœ… The lifetime of the toast (seconds)
titleColor string null Both βœ… βœ…
shouldDismissByDrag boolean true Both βœ… The behavior on Android is click
position string top Both βœ… Toast is displayed from top or bottom
haptic string null iOS βœ… success, warning, error, none
shouldDismissByTap boolean true Both βœ…
borderRadius number null Both βœ…
blurBackdrop number null Android βœ…
backdropOpacity number null Android βœ…
backgroundColor string #ffffff Both βœ… βœ… New_Feature

Icon

icon Type Default value Platform
uri string null Both
size number null Both

To Do

  • shouldDismissByDrag on Android
  • callback
  • Initialize for the first time
  • tintColor for icon
  • backgroundColor

Performance

We're trying to improve performance. If you have a better solution, please open a issue or pull request. Best regards!

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT AlertKit SPIndicator EasyWindow

About

🍞 Flexible and customizable React Native toast/alert notifications with support for positioning, custom rendering, click handlers, and duration control. Written in Swift and Kotlin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 25.1%
  • TypeScript 22.4%
  • Kotlin 19.5%
  • Java 14.1%
  • Ruby 7.1%
  • Objective-C 4.9%
  • Other 6.9%