rc-message
a message notice ui component for react
Last updated 2 years ago by jinke.li .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rc-message 
SYNC missed versions from official npm registry.

react-message

npm npm Build Status npm version

a message notice ui component for react

Installation

using npm

npm install rc-message --save

using yarn

yarn add rc-message

Screenshots

success confirm prompt dark

Example

https://lijinke666.github.io/react-message/

Development

git clone https://github.com/lijinke666/react-message
npm install | yarn
npm start
open `http://localhost:3000/`

Usage

import Message from "rc-message"
import "rc-message/assets/index.css"
Message.success({
    content:"hello world"
})

API

  • Message.success(options)
  • Message.error(options)
  • Message.info(options)
  • Message.warning(options)
  • Message.loading(options)
  • Message.confirm(options)
  • Message.prompt(options)

Options

  • options.content

    • Desc : content of the message
    • Type : string | ReactNode
    • Default : -
  • options.duration

    • Desc : time before auto-dismiss,in seconds
    • Type : number
    • Default : 2
  • options.theme

    • Desc : theme of the message
    • Type : string
    • Default : light
  • options.onClose

    • Desc : Specify a function that will be called after the message closed
    • Type : Function
    • Default : -

Special options

Base Options of the confirm() and prompt()

  • options.content

    • Desc : content of the message
    • Type : string | ReactNode
    • Default : -
  • options.okText

    • Desc : Text of the OK button
    • Type : string
    • Default : Ok
  • options.cancelText

    • Desc : Text of the Cancel button
    • Type : string
    • Default : Cancel
  • options.onOk

    • Desc : Specify a function that will be called when a user clicked OK buttond
    • Type : Function
    • Default : -
  • options.onCancel

    • Desc : Specify a function that will be called when a user clicked mask, close button on top right or cancel button
    • Type : Function
    • Default : -
  • Message.prompt(options)

    • options.inputType
      • Desc : input html type of the message
      • Type : string
      • Default : text
    • options.placeholder
      • Desc : input placeholder of the message
      • Type : string
      • Default : -

Current Tags

  • 1.3.7                                ...           latest (2 years ago)

10 Versions

  • 1.3.7                                ...           2 years ago
  • 1.3.6                                ...           2 years ago
  • 1.3.5                                ...           2 years ago
  • 1.3.4                                ...           2 years ago
  • 1.3.3                                ...           3 years ago
  • 1.3.2                                ...           3 years ago
  • 1.3.1                                ...           3 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 4
Last Day 1
Last Week 1
Last Month 6
Dependencies (3)
Dev Dependencies (61)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |