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: 17 days 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 (10 months ago)
- Default Branch: main
- Last Pushed: 2024-10-16T10:38:34.000Z (7 months ago)
- Last Synced: 2024-10-19T03:49:16.960Z (6 months ago)
- Topics: react, react-block, react-portal, typescript
- Language: TypeScript
- Homepage: https://acrool-react-block.pages.dev/
- Size: 963 KB
- Stars: 6
- Watchers: 1
- 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 Block - React Block loading (React underlying structure)
- 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.hideThere 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)