# react-antd-window

> react antd window.

Latest version **0.1.2** (published 2015-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-antd-window
pnpm add react-antd-window
yarn add react-antd-window
bun add react-antd-window
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2015-09-24 |
| First published | 2015-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | zhbhun |
| Maintainers | zhbhun |
| Keywords | web, react, react-component, antd, window, modal, dialog, front-end |

## Links

- npm: https://www.npmjs.com/package/react-antd-window
- Repository: https://github.com/zhbhun/react-antd-window
- Homepage: http://github.com/zhbhun/react-antd-window
- Issues: https://github.com/zhbhun/react-antd-window/issues
- npm.io page: https://npm.io/package/react-antd-window

## Dependencies (4)

- [antd](https://npm.io/package/antd.md) ^0.9.0
- [react](https://npm.io/package/react.md) ~0.13.3
- [object-assign](https://npm.io/package/object-assign.md) ^4.0.1
- [react-window-kit](https://npm.io/package/react-window-kit.md) ^0.1.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2015-09-24
- 0.1.1 — 2015-09-24

## README

# react-antd-window
Antd window component, wrap around [react-window-kit](https://github.com/zhbhun/react-window-kit).

# Install
`npm install --save react-antd-window`

# Usage
## Modal
``` javascript
class ModalDemo extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            show: false
        }
    }

    render() {
        return (
            <div>
                <button onClick={this.openWindow.bind(this)}>open modal</button>
                <Modal
                    visible={this.state.show}
                    size='lg'
                    header='Title'
                    onHide={this.closeWindow.bind(this)}
                    onCancel={this.closeWindow.bind(this)}
                    onConfirm={this.closeWindow.bind(this)}
                    >
                    <h3>Hello Modal!</h3>
                </Modal>
            </div>
        )
    }

    openWindow() {
        this.setState({
            show: true
        })
    }

    closeWindow() {
        this.setState({
            show: false
        })
    }
}
React.render(<ModalDemo/>, document.getElementById('modal-demo'));
```
![modal](./doc/modal.png)

## Confirm
``` javascript
class ConfirmDemo extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            show: false
        }
    }

    render() {
        return (
            <div>
                <button onClick={this.openWindow.bind(this)}>open confirm</button>
                <Confirm
                    visible={this.state.show}
                    title='Are you sure!'
                    onCancel={this.closeWindow.bind(this)}
                    onOk={this.closeWindow.bind(this)}
                    >
                    Hello Modal! Hello Modal! Hello Modal! Hello Modal! Hello Modal!
                </Confirm>
            </div>
        )
    }

    openWindow() {
        this.setState({
            show: true
        })
    }

    closeWindow() {
        this.setState({
            show: false
        })
    }
}
React.render(<ConfirmDemo/>, document.getElementById('confirm-demo'));
```

![Confirm](./doc/confirm.png)

## Tip
``` javascript
class ConfirmTip extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            show: false
        }
    }

    render() {
        return (
            <div>
                <button onClick={this.openWindow.bind(this)}>open tip</button>
                <Tip
                    visible={this.state.show}
                    type='info'
                    title='Are you sure!'
                    onOk={this.closeWindow.bind(this)}
                    >
                    Hello Modal! Hello Modal! Hello Modal! Hello Modal! Hello Modal!
                </Tip>
            </div>
        )
    }

    openWindow() {
        this.setState({
            show: true
        })
    }

    closeWindow() {
        this.setState({
            show: false
        })
    }
}
React.render(<ConfirmTip/>, document.getElementById('tip-demo'));
```

![Tip](./doc/tip.png)

# API
## Window
| name | type | default | description |
| ------------ | ------------ | ------------ | ------------ |
| visible | Boolean | false | whether show window |
| position | Object | `{align: 'cc', offset: [0, 0]}` | Align option values: tr, tc, tl, cl, cc, cr, bl, bc, br. |
| size | Object  |   | width, height |
| closable | Boolean | true |  |
| maximizable | Boolean | false |   |
| backdrop | Boolean | true |   |
| keyboard | Boolean | true |   |
| animation | Boolean/ReactComponent |   |   |
| onAlign | function |   |   |
| onShown | function |   |   |
| onHide | function |   |   |
| onHidden | function |   |   |

## Modal
| name | type | default | description |
| ------------ | ------------ | ------------ | ------------ |
| visible | Boolean | false | whether show modal |
| size | String | md | fl: full screen, lg, md, sm |
| header | ReactElement |   |   |
| footer | ReactElement |   |   |
| onHide | function |   |   |

## Confirm
| name | type | default | description |
| ------------ | ------------ | ------------ | ------------ |
| visible | Boolean | false | whether show confirm |
| title | String |   |   |
| onCancel | function |   |   |
| onOk | function |   |   |

## Tip
| name | type | default | description |
| ------------ | ------------ | ------------ | ------------ |
| visible | Boolean | false | whether show Tip |
| type | String | info | info, success, warning, danger |
| title | String |   |   |
| onOk | function |   |   |

# License
react-antd-window is released under the MIT license.

---
_Source: https://npm.io/package/react-antd-window · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
