https://github.com/acrool/acrool-react-block
react block component
https://github.com/acrool/acrool-react-block
react react-block react-portal typescript
Last synced: 5 months ago
JSON representation
react block component
- Host: GitHub
- URL: https://github.com/acrool/acrool-react-block
- Owner: acrool
- License: mit
- Created: 2024-07-14T04:04:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-14T08:38:07.000Z (6 months ago)
- Last Synced: 2025-06-05T09:56:02.236Z (6 months ago)
- Topics: react, react-block, react-portal, typescript
- Language: TypeScript
- Homepage: https://acrool-react-block.pages.dev/
- Size: 2.07 MB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
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 Block - React Block loading (React underlying structure)
README
# Acrool React Block
This is a toast message function for React development notifications
[](https://www.npmjs.com/package/@acrool/react-block)
[](https://github.com/acrool/@acrool/react-block/blob/main/LICENSE)
[](https://github.com/acrool/react-block/blob/main/LICENSE)
[](https://www.npmjs.com/package/@acrool/react-block)
[](https://www.npmjs.com/package/@acrool/react-block)
## Features
- Supports queue block list
- Plug and unplug using `@acrool/react-portal` and `framer-motion`
## Install
```bash
yarn add framer-motion @acrool/react-block
```
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-block/dist/index.css";
```
add in your App.tsx
```tsx
import {BlockPortal} from "@acrool/react-block";
const App = () => {
return (
}
defaultMessage="Loading..."
/>
);
};
```
then in your page
```tsx
import {block} from '@acrool/react-block';
import {useEffect} from "react";
const Example = () => {
useEffect(() => {
block.show();
setTimeout(() => {
block.hide();
}, 3000)
}, []);
return (
sample page
);
};
```
- block.show
- block.hide
There is also a example that you can play with it:
[](https://acrool-react-block.pages.dev)
## License
MIT © [Acrool](https://github.com/acrool) & [Imagine](https://github.com/imagine10255)