Giter Club home page Giter Club logo

ppeerit-react-toast's Introduction

Toast for React.js.

δΈ­ζ–‡ README

Installation

use npm

$ npm install ppeerit-react-toast --save

Import into your project

// ES6
// ReactToast is a react component,you can add the ReactToast component in the higher dom node
// toast is a object that has some method to dispatch toast
import ReactToast, {toast} from 'ppeerit-react-toast';

Show toast

just do the method

toast.show('i`am a toast!!!');

Options

toast.show function has message, type, config attributes toast.show(message, type, config)

message is the toast content.

the message attribute must be set

type can use this variants:

  • success render success style.
  • warning render warning style.
  • error render error style.
  • info render info style.

config is the config set, it is a object

  • timeout after the time, component will unmount. default value is 3000
  • position the place where will show the toast. default value is default
    • top top space.
    • bottom bottom space.
    • default middle-bottom space.
  • backgroundColor custom background-color, it will replace type attr's style.
  • textColor custom color, it will replace type attr's style.

wait more ability ...

ppeerit-react-toast's People

Contributors

czewail avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.