Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/acrool/acrool-react-dialog
- Owner: acrool
- License: mit
- Created: 2024-07-11T07:47:47.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-10-16T10:56:40.000Z (2 months ago)
- Last Synced: 2024-10-16T13:21:40.496Z (2 months ago)
- Topics: react, react-dialog, react-portal, typescript
- Language: TypeScript
- Homepage: https://acrool-react-dialog.pages.dev/
- Size: 981 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-react - Acrool React Dialog - React Dialog (React underlying structure)
- awesome-react - Acrool React Dialog - React Dialog (React underlying structure)
README
# Acrool React Dialog
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.confirmThere 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)