0.1.47 • Published 1 year ago
modal-g v0.1.47
modal-g
Modal component based on antd with React
Screenshot
Demo
online example: https://favori.gitee.io/gantd-landing (CodePen)
install
Feature
- Support drag and resize
- Can switch to maximize
- Respond to browser window size changes in real time
- Modal status persists during mounting
- Support Modeless and multi-modal modes
Usage
import React, { useState } from 'react';
import Modal from 'modal-g';
import { Button } from 'antd';
function BasicUse() {
const [visible, setVisible] = useState(false)
const [widthAndHei, setWidthAndHei] = useState([400, 400])
const onSizeChange = (width, height) => {
setWidthAndHei([width, height])
}
return <div style={{ margin: 10 }}>
<div style={{ marginBottom: 10 }}>
<Button size="small" onClick={() => { setVisible(true) }}>click</Button>
</div>
<Modal
title='custom title'
itemState={{ height: 400, width: 400 }}
visible={visible}
footer={null}
onCancel={() => { setVisible(false) }}
onSizeChange={onSizeChange}
>
<div>
<h4>Dynamic width and height(included header+footer):</h4>
<div>{`width:${widthAndHei[0]}px`}</div>
<div>{`height:${widthAndHei[1]}px`}</div>
</div>
</Modal>
</div>
}
React.render(<BasicUse/>, mountNode);
API
Contact
- Create a Github issue for bug reports, feature requests, or questions
- Follow @GantFDT for announcements
- Add a ⭐️ star on GitHub to support the project❤️!
Anthor
GantFDT
License
MIT
0.1.47
1 year ago
0.1.46
2 years ago
0.1.42
2 years ago
0.1.43
2 years ago
0.1.45
2 years ago
0.1.41
3 years ago
0.1.40
3 years ago
0.1.39
3 years ago
0.1.38
3 years ago
0.1.37
3 years ago
0.1.36
4 years ago
0.1.35
4 years ago
0.1.32
4 years ago
0.1.33
4 years ago
0.1.34
4 years ago
0.1.31
4 years ago
0.1.30
4 years ago
0.1.29
4 years ago
0.1.28
4 years ago
0.1.27
4 years ago
0.1.25
4 years ago
0.1.24
5 years ago
0.1.23
5 years ago
0.1.22
5 years ago
0.1.21
5 years ago
0.1.20
5 years ago
0.1.19
5 years ago
0.1.18
5 years ago
0.1.17
5 years ago
0.1.16
5 years ago
0.1.15
5 years ago
0.1.14
5 years ago
0.1.13
5 years ago
0.1.12
5 years ago
0.1.11
5 years ago
0.1.10
5 years ago
0.1.9
5 years ago
0.1.8
5 years ago
0.1.5
5 years ago
0.1.4
5 years ago
0.1.3
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago
0.0.24
5 years ago
0.0.22
5 years ago
0.0.23
5 years ago
0.0.21
5 years ago
0.0.20
5 years ago
0.0.18
5 years ago
0.0.19
5 years ago
0.0.17
5 years ago
0.0.15
5 years ago
0.0.16
5 years ago
0.0.13
5 years ago
0.0.12
5 years ago
0.0.1
5 years ago