Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/acrool/acrool-react-dialog

react dialog atom component
https://github.com/acrool/acrool-react-dialog

react react-dialog react-portal typescript

Last synced: about 1 month ago
JSON representation

react dialog atom component

Awesome Lists containing this project

README

        

# Acrool React Dialog


Acrool React Dialog Logo


This is a dialog message function for React development dialog

[![NPM](https://img.shields.io/npm/v/@acrool/react-dialog.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-dialog)
[![npm](https://img.shields.io/bundlejs/size/@acrool/react-dialog?style=for-the-badge)](https://github.com/acrool/@acrool/react-dialog/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/l/@acrool/react-dialog?style=for-the-badge)](https://github.com/acrool/react-dialog/blob/main/LICENSE)

[![npm downloads](https://img.shields.io/npm/dm/@acrool/react-dialog.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-dialog)
[![npm](https://img.shields.io/npm/dt/@acrool/react-dialog.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-dialog)

## Features

- Supports 5 status colors: default, success, info, warning, danger
- Call via global method
- Plug and unplug using `@acrool/react-portal` and `framer-motion`

## Install

```bash
yarn add framer-motion @acrool/react-dialog
```

in your packages. (Make the version of styled-component you use match the version of styled-component used in acrool-react-gird)

```json
"resolutions": {
"framer-motion": "^11.x"
}
```

## Usage

add in your index.tsx
```tst
import "@acrool/react-dialog/dist/index.css";
```

add in your App.tsx

```tsx
import {DialogPortal} from "@acrool/react-dialog";

const App = () => {
return (


createElement(Button, args, args.children)}
renderTextField={args => createElement(TextField, args, null)}
/>


);
};
```

then in your page
```tsx
import {EStatus, toast} from '@acrool/react-dialog';

const Example = () => {
return (


dialog({message: 'step1 test dialog', code: 'TEST1'})}>
useDialog message


);
};
```

- dialog
- dialog.success
- dialog.info
- dialog.warning
- dialog.error
- dialog.confirm

There is also a example that you can play with it:

[![Play react-editext-example](https://raw.githubusercontent.com/acrool/acrool-react-dialog/main/play-in-example-button.svg)](https://acrool-react-dialog.pages.dev)

## License

MIT © [Acrool](https://github.com/acrool) & [Imagine](https://github.com/imagine10255)