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

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

Awesome Lists containing this project

README

        

# Acrool React Block


Acrool React Block Logo


This is a toast message function for React development notifications

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

[![npm downloads](https://img.shields.io/npm/dm/@acrool/react-block.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-block)
[![npm](https://img.shields.io/npm/dt/@acrool/react-block.svg?style=for-the-badge)](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:

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

## License

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