New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

modal-g

Package Overview
Dependencies
Maintainers
8
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modal-g

gantd modal

  • 0.1.47
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by33.33%
Maintainers
8
Weekly downloads
 
Created
Source

modal-g


Modal component based on antd with React

NPM version

Screenshot

Demo

online example: https://favori.gitee.io/gantd-landing (CodePen)

install

rc-tabs

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

Documentation

Contact

Anthor

GantFDT

License

MIT

Keywords

FAQs

Package last updated on 03 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc