1.3.7 • Published 7 years ago
rc-message v1.3.7
react-message
a message notice ui component for react
Installation
using
npmnpm install rc-message --saveusing
yarnyarn add rc-message
Screenshots

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 messageType:string | ReactNodeDefault:-
options.duration
Desc:time before auto-dismiss,in secondsType:numberDefault:2
options.theme
Desc:theme of the messageType:stringDefault:light
options.onClose
Desc:Specify a function that will be called after the message closedType:FunctionDefault:-
Special options
Base Options of the
confirm()andprompt()
options.content
Desc:content of the messageType:string | ReactNodeDefault:-
options.okText
Desc:Text of the OK buttonType:stringDefault:Ok
options.cancelText
Desc:Text of the Cancel buttonType:stringDefault:Cancel
options.onOk
Desc:Specify a function that will be called when a user clicked OK buttondType:FunctionDefault:-
options.onCancel
Desc:Specify a function that will be called when a user clicked mask, close button on top right or cancel buttonType:FunctionDefault:-
Message.prompt(options)- options.inputType
Desc:input html type of the messageType:stringDefault:text
- options.placeholder
Desc:input placeholder of the messageType:stringDefault:-
- options.inputType