Code Monkey home page Code Monkey logo

notification's Introduction

rc-notification


React Notification UI Component

NPM version build status Test coverage gemnasium deps node version npm download

Development

npm install
npm start

Example

http://localhost:8000/examples/

online example: http://react-component.github.io/notification/examples/

Feature

  • support ie9,ie9+,chrome,firefox,safari

install

rc-notification

Usage

var Notification = require('rc-notification');
Notification.newInstance({}, notification => {
  notification.notice({
    content: 'content'
  });
});

API

Notification.newInstance(props, (notification) => void) => void

props details:

name type default description
prefixCls String prefix class name for notification container
style Object {'top': 65, left: '50%'} additional style for notification container.
getContainer getContainer(): HTMLElement function returning html node which will act as notification container

notification.notice(props)

props details:

name type default description
content React.Element content of notice
key String id of this notice
closable Boolean whether show close button
onClose Function called when notice close
duration number 1.5 after duration of time, this notice will disappear.(seconds)
style Object { right: '50%' } additional style for single notice node.
maxCount number max notices show, drop first notice if exceed limit
closeIcon ReactNode specific the close icon.

notification.removeNotice(key:string)

remove single notice with specified key

notification.destroy()

destroy current notification

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-notification is released under the MIT license.

notification's People

Contributors

yiminghe avatar afc163 avatar paranoidjk avatar yesmeck avatar benjycui avatar nikogu avatar hezigang avatar heskeybaozi avatar jzhng avatar yevhen-hryhorevskyi avatar dfperrino avatar zombiej avatar ztplz avatar darmody avatar ojame avatar eternalsky 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.