# react-bullet-screen

> A lightweight customizable React infinite loop bullet screen component

Latest version **0.1.2** (published 2020-11-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-bullet-screen
pnpm add react-bullet-screen
yarn add react-bullet-screen
bun add react-bullet-screen
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2020-11-26 |
| First published | 2020-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 26.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | tong233 |
| Maintainers | tong233 |
| Keywords | 弹幕, danmaku, barrage, bullet, bullet-screen, react, danmu |

## Links

- npm: https://www.npmjs.com/package/react-bullet-screen
- Repository: https://github.com/tong233/react-bullet-screen
- Homepage: https://github.com/tong233/react-bullet-screen#readme
- Issues: https://github.com/tong233/react-bullet-screen/issues
- npm.io page: https://npm.io/package/react-bullet-screen

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^16.13.1
- [react-dom](https://npm.io/package/react-dom.md) ^16.13.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2020-11-26
- 0.1.1 — 2020-05-17
- 0.1.0 — 2020-05-17

## README

# React-Bullet-Screen

🚀 A lightweight customizable React infinite loop bullet screen component. [live demo](https://tong233.github.io/react-bullet-screen/)
一个轻量的可自定义的React无限循环弹幕组件. 

## Installation

```bash
npm install react-bullet-screen --save
```

## Usage

```javascript
import React, { useState } from 'react'
import Bullet from 'react-bullet-screen'

const text = [
  'I am the first',
  'I am the second ha',
  'I am the third haha',
  'I am the fourth hahaha',
  'I am the fifth hahahahaha',
]

const App = () => {
  const [data] = useState(text)

  const renderItem = (item) => {
    return <div className="item">{item}</div>
  }

  return data.length ? (
    <Bullet
      data={data}
      renderItem={renderItem}
      speed={50}
      row={3}
      rowHeight={40}
      spacing={120}
    />
  ) : null
}
```

## API

| Prop | Description | Type | Default | required
| --- | --- | --- | -- | -- |
| data | Barrage datas | T[] | [] | true
| renderItem | Render every barrage | (item: T) => React.ReactElement | () => undefined  | true
| speed | Barrage movement speed (px/s) | number | 50  | false
| row | Number of tracks | number | 3  | false
| rowHeight | Movement track height (px) | number | 200 | false
| spacing | Barrage Horizontal spacing (px) | number | 120 | false

## License
MIT

---
_Source: https://npm.io/package/react-bullet-screen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
