popover-react
v0.0.21
Published
React Modal
Downloads
2
Readme
npm install popover-react
yarn add popover-react
🔨 Usage
Modal
one:
const { update, destroy } = Modal.show(options)
//update(options)
//destroy()
- options: [all is optional]
- maskClosable: boolean
- duration: number
- position: 'top' | 'bottom' | 'right' | 'left' | 'center'
- edge: boolean
- bg: string
- contentClassName: string
- children: ReactNode
two:
<Modal visible={true} maskClosable={true} position={"center"}>
<div>content</div>
</Modal>
- options: [all is optional]
- visible: boolean
- maskClosable: boolean
- duration: number
- position: 'top' | 'bottom' | 'right' | 'left' | 'center'
- edge: boolean
- onClose: Function
- bg: string
- contentClassName: string
Toast
import {Toast} from 'popover-react'
const A = () => <span>f</span>
const options = {
duration: 2000,
bg: '#ffffff',
color: 'rgba(0,0,0,.88)',
size: 14,
radius: 4,
className: '',
position: 'center',
onHide: () => {}
}
Toast.show(<div>dd</div>, options)
Toast.show(dd)
Toast.show(<A />)
or
import {Toast} from 'popover-react'
const options = {
visible: false,
duration: 2000,
bg: '#ffffff',
color: 'rgba(0,0,0,.88)',
size: 14,
radius: 4,
className: '',
position: 'center',
onHide: () => {}
}
<Toast {...options}>toast can be any type data</Toast>