Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

fireworks-js

> 前端框架
Open source

A simple fireworks library! Ready to use components available for React, Vue 3, Svelte, Angular, Preact, Solid, and Web Components.

1.4K stars0 likes3 views
WebsiteGitHub

About

A simple fireworks library! Ready to use components available for React, Vue 3, Svelte, Angular, Preact, Solid, and Web Components.

A simple fireworks library! | fireworks.js.org

</picture>


Table of Contents

Warning
This readme refers to upcoming v2 version, read here for v1 documentation.

  • Features
  • Browsers support
  • Demo
  • Installation
  • CDN
  • Usage
    • fireworks-js
    • @fireworks-js/react
    • @fireworks-js/preact
    • @fireworks-js/solid
    • @fireworks-js/vue
    • @fireworks-js/svelte
    • @fireworks-js/angular
    • @fireworks-js/web
  • Documentation
    • Options
    • API
  • Community

Features

  • Zero dependencies
  • ⚙️ Flexible configuration
  • Lightweight (~3.0kB gzipped)
  • Supports TypeScript type definition

Browsers support


Edge

Firefox

Chrome

Safari

iOS Safari

Opera

Yandex
✔ ✔ ✔ ✔ ✔ ✔ ✔

Demo

You can play with fireworks-js at fireworks.js.org or stackblitz.com

Installation

bash
npm install fireworks-js
bash
yarn add fireworks-js
bash
pnpm add fireworks-js
Package Status Description
fireworks-js Vanilla JS
@fireworks-js/react React component
@fireworks-js/preact Preact component
@fireworks-js/solid Solid component
@fireworks-js/vue Vue 3 component
@fireworks-js/svelte Svelte component
@fireworks-js/angular Angular component
@fireworks-js/web Web components

CDN

xml

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.umd.js"></script>

<script src="https://unpkg.com/[email protected]/dist/index.umd.js"></script>

<script>
  const container = document.querySelector('.fireworks')
  const fireworks = new Fireworks.default(container)
  fireworks.start()
</script>

Usage

fireworks-js

javascript
import { Fireworks } from 'fireworks-js'

const container = document.querySelector('.container')
const fireworks = new Fireworks(container, { /* options */ })
fireworks.start()

@fireworks-js/react

bash
npm install @fireworks-js/react

@fireworks-js/preact

bash
npm install @fireworks-js/preact

@fireworks-js/solid

bash
npm install @fireworks-js/solid

@fireworks-js/vue

bash
npm install @fireworks-js/vue

@fireworks-js/svelte

bash
npm install @fireworks-js/svelte

@fireworks-js/angular

bash
npm install @fireworks-js/angular

@fireworks-js/web

bash
npm install @fireworks-js/web

Documentation

Options

Note
The options is optional, as are each of its properties.

Property Type Default
hue object hue
rocketsPoint object rocketsPoint
mouse object mouse
boundaries object boundaries
sound object sound
delay object delay
brightness object brightness
decay object decay
lineWidth object lineWidth
lineStyle string round
explosion number 5
opacity number 0.5
acceleration number 1.05
friction number 0.95
gravity number 1.5
particles number 50
traceLength number 3
flickering number 50
intensity number 30
traceSpeed number 10
intensity number 30
autoresize boolean true

The hue, delay, decay, brightness, lineWidth.explosion, lineWidth.trace, sound.volume and rocketsPoint options accept an object:

Property Type
min number
max number

Note
The min and max properties are used to randomly select values from the range.

The mouse options accept an object:

Property Type Default
click boolean false
move boolean false
max number 1

Note
The max property has no effect if click is false.

The sound options accept an object:

Property Type Default
enabled boolean false
files string[] files
volume object volume
…

API

.start()

Start fireworks.

.launch(count)

Launching a specified number of fireworks.
Type: number
Default 1

.stop(dispose)

Stop fireworks.
Type: boolean
Default: false

.waitStop(dispose)

Asynchronous stopping of the fireworks.
Type: boolean
Default: false

.pause()

Start/stop fireworks.

.clear()

Cleaning the canvas from fireworks.

.currentOptions

Getting current fireworks options.

.updateOptions(options)

Force update fireworks options.
Type: options

.updateSize(sizes)

Force update canvas size.
Type: sizes

.updateBoundaries(boundaries)

Force update canvas boundaries.
Type: boundaries

Community

Star History

Author

  • crashmax

License

  • MIT

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptangularanimationcanvasfireworks

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架