All Projects → wangsijie → antd-prompt

wangsijie / antd-prompt

Licence: MIT license
An ant.design helper that auto create a Modal with an optional message prompting the user to input some text.

Programming Languages

typescript
32286 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to antd-prompt

react-vite-admin
This Starter utilizes React, Recoil, React Query, React Hooks, Typescript, Axios And Vite. 全新技术栈的后台管理系统
Stars: ✭ 90 (+592.31%)
Mutual labels:  antd, antd-design
promotion-web
基于React: v18.x.x/Webpack: v5.x.x/React Router v6.x.x/ Antd: v5..x.x/Fetch Api/ Typescript: v4.x.x 等最新版本进行构建...
Stars: ✭ 374 (+2776.92%)
Mutual labels:  antd, antd-design
Next Terminal
Next Terminal是一个轻量级堡垒机系统,易安装,易使用,支持RDP、SSH、VNC、Telnet、Kubernetes协议。
Stars: ✭ 2,354 (+18007.69%)
Mutual labels:  antd, antd-design
ant-design-icons
Ant Design + Material Design Icon =
Stars: ✭ 21 (+61.54%)
Mutual labels:  antd
nextjs-antd-custom
This project we created a simple project with Nextjs and use Ant Design for CSS components and also deploy that with Now.sh
Stars: ✭ 28 (+115.38%)
Mutual labels:  antd
Demeter
Nodejs/ES6/Rxjs/MySQL/Express/Webpack/React/Redux/AntD
Stars: ✭ 43 (+230.77%)
Mutual labels:  antd
dva-graphql-lokka-user-dashboard
A Study Project Related to Dva.js, GraphQL, Graph.cool, Lokka
Stars: ✭ 20 (+53.85%)
Mutual labels:  antd
Gatsby Theme Antv
⚛️ Polished Gatsby theme for documentation site
Stars: ✭ 249 (+1815.38%)
Mutual labels:  antd
picker
📅 All Date Pickers you need.
Stars: ✭ 185 (+1323.08%)
Mutual labels:  antd
React-Nest-Admin
admin project powered by 🚀 React + Nestjs + Antd 全栈中后台,后端项目:https://github.com/cnscorpions/React-Nest-Admin-be
Stars: ✭ 37 (+184.62%)
Mutual labels:  antd
jswallet
An experimental Bitcoin Wallet in Electron + React.js
Stars: ✭ 91 (+600%)
Mutual labels:  antd
zero-admin-ui
基于Go-Zero + Ant Design Pro的前后端分离微服务管理系统的前端模块
Stars: ✭ 104 (+700%)
Mutual labels:  antd-design
Min-Admin
基于dva框架+antd的React后台模板
Stars: ✭ 17 (+30.77%)
Mutual labels:  antd
antd-form-mate
📦 基于 ant design 的表单组件,配置化实现表单功能。
Stars: ✭ 14 (+7.69%)
Mutual labels:  antd
nextjs-antd-dva-template
最优的nextjs antd dva 服务端解决方案
Stars: ✭ 15 (+15.38%)
Mutual labels:  antd
react-antd-formutil
Happy to use react-formutil in the project based on ant-design ^_^
Stars: ✭ 16 (+23.08%)
Mutual labels:  antd
react-project-tpl
react project template
Stars: ✭ 32 (+146.15%)
Mutual labels:  antd
elm-antd
The official Ant Design UI Kit for Elm
Stars: ✭ 56 (+330.77%)
Mutual labels:  antd
ant-design-svelte
An enterprise-class UI design language and Svelte-based implementation 🐜
Stars: ✭ 86 (+561.54%)
Mutual labels:  antd
react-antd-admin
react-antd-admin 是一个后台集成解决方案,它基于 react 和 antd; 内置了动态路由,标签页缓存,权限验证、切换功能
Stars: ✭ 42 (+223.08%)
Mutual labels:  antd

antd-prompt

An ant.design helper that auto create a Modal with an optional message prompting the user to input some text.

Support antd v4.

Installation

npm i antd-prompt

Usage

Edit antd-prompt

import React, { component } from 'react';
import ReactDOM from 'react-dom';
import prompt from 'antd-prompt';
import { Button, message } from 'antd';

class App extends Component {
    handler = async () => {
        try {
            const name = await prompt({
                title: "Please enter name",
                placeholder: "Your name",
                rules: [
                    // check this link for more help: https://ant.design/components/form/#Validation-Rules
                    {
                        required: true,
                        message: "You must enter name"
                    }
                ],
                modalProps: {
                    width: '80%'
                }
            });
        } catch (e) {
            message.error('Please enter name');
        }
    }
    render() {
        return <div>
            <Button onClick={this.handler}>Set Name</Button>
        </div>
    }
}

ReactDOM.render(<App />, document.getElementById('root'));

Keep modal open after submit

import React, { component } from 'react';
import ReactDOM from 'react-dom';
import prompt from 'antd-prompt';
import { Button, message } from 'antd';

class App extends Component {
    handler = async () => {
        await prompt({
            title: "Please enter name",
            value: 'Initial Value',
            modalProps: {
                width: '80%'
            },
            onOk: name => {
                // do something with name
                return false;
                // or return Promise.resolve(false);
            }
        });
    }
    render() {
        return <div>
            <Button onClick={this.handler}>Set Name</Button>
        </div>
    }
}

ReactDOM.render(<App />, document.getElementById('root'));
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].