# @tsparticles/preset-stars

> tsParticles stars preset

Latest version **4.4.0** (published 2026-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tsparticles/preset-stars
pnpm add @tsparticles/preset-stars
yarn add @tsparticles/preset-stars
bun add @tsparticles/preset-stars
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.4.0 |
| Published | 2026-08-31 |
| First published | 2023-01-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 550.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 8977 |
| Author | Matteo Bruni |
| Maintainers | matteobruni |
| Keywords | front-end, frontend, tsparticles, particles.js, particlesjs, particles, particle, canvas, jsparticles, xparticles, particles-js, particles-bg, particles-bg-vue, particles-ts, particles.ts, react-particles-js, react-particles.js, react-particles, react, reactjs, vue-particles, ngx-particles, angular-particles, particleground, vue, vuejs, preact, preactjs, jquery, angularjs, angular, typescript, javascript, animation, web, html5, web-design, webdesign, css, html, css3, animated, background, confetti, canvas, fireworks, fireworks-js, confetti-js, confettijs, fireworksjs, canvas-confetti, tsparticles-preset |

## Links

- npm: https://www.npmjs.com/package/@tsparticles/preset-stars
- Repository: https://github.com/tsparticles/tsparticles
- Homepage: https://particles.js.org
- Issues: https://github.com/tsparticles/presets/issues
- Funding: https://github.com/sponsors/matteobruni
- npm.io page: https://npm.io/package/@tsparticles/preset-stars

## Dependencies (2)

- [@tsparticles/basic](https://npm.io/package/@tsparticles/basic.md) 4.4.0
- [@tsparticles/engine](https://npm.io/package/@tsparticles/engine.md) 4.4.0

## Alternatives

- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads

## Recent versions

- 4.4.0 (latest) — 2026-08-31
- 4.0.0-beta.17 (beta) — 2026-05-15
- 4.0.0-alpha.5 (alpha) — 2026-03-31
- 3.0.0 (next) — 2023-12-05
- 4.3.2 — 2026-07-10
- 4.3.1 — 2026-07-01
- 4.3.0 — 2026-06-27
- 4.2.1 — 2026-06-19
- 4.2.0 — 2026-06-17
- 4.1.3 — 2026-06-03
- 4.1.2 — 2026-06-01
- 4.1.1 — 2026-05-31
- 4.1.0 — 2026-05-29
- 4.0.5 — 2026-05-19
- 4.0.4 — 2026-05-19
- … 20 more at https://npm.io/package/@tsparticles/preset-stars/versions

## README

[![banner](https://particles.js.org/images/banner3.png)](https://particles.js.org)

# tsParticles Stars Preset

[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/preset-stars/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/preset-stars) [![npmjs](https://badge.fury.io/js/@tsparticles/preset-stars.svg)](https://www.npmjs.com/package/@tsparticles/preset-stars) [![npmjs](https://img.shields.io/npm/dt/@tsparticles/preset-stars)](https://www.npmjs.com/package/@tsparticles/preset-stars) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)

[tsParticles](https://github.com/tsparticles/tsparticles) preset for creating a starry night effect with blinking stars.

[![Discord](https://particles.js.org/images/discord.png)](https://discord.gg/hACwv45Hme) [![Telegram](https://particles.js.org/images/telegram.png)](https://t.me/tsparticles)

[![tsParticles Product Hunt](https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=186113&theme=light)](https://www.producthunt.com/posts/tsparticles?utm_source=badge-featured&utm_medium=badge&utm_source=badge-tsparticles) <a href="https://www.buymeacoffee.com/matteobruni"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a beer&emoji=🍺&slug=matteobruni&button_colour=5F7FFF&font_colour=ffffff&font_family=Arial&outline_colour=000000&coffee_colour=FFDD00"></a>

## Sample

[![demo](https://raw.githubusercontent.com/tsparticles/tsparticles/main/presets/stars/images/sample.png)](https://particles.js.org/demos/recipes/stars)

## Quick checklist

1. Install `@tsparticles/engine` (or use the CDN bundle below)
2. Call `loadStarsPreset(tsParticles)` **before** `tsParticles.load(...)`
3. Set `preset: "stars"` in options

## How to use it

### CDN / Vanilla JS / jQuery

```html
<script src="https://cdn.jsdelivr.net/npm/@tsparticles/preset-stars@4/tsparticles.preset.stars.bundle.min.js"></script>
```

### Usage

Once the scripts are loaded you can set up `tsParticles` like this:

```javascript
(async () => {
  await loadStarsPreset(tsParticles);

  await tsParticles.load({
    id: "tsparticles",
    options: {
      preset: "stars",
    },
  });
})();
```

#### Customization

**Important ⚠️**
You can override all the options defining the properties like in any standard `tsParticles` installation.

```javascript
tsParticles.load({
  id: "tsparticles",
  options: {
    particles: {
      shape: {
        type: "square", // starting from v2, this require the square shape script
      },
    },
    preset: "stars",
  },
});
```

Like in the sample above, the circles will be replaced by squares.

### Frameworks with a tsParticles component library

Checkout the documentation in the component library repository and call the `loadStarsPreset` function instead
of `loadFull`, `loadSlim` or similar functions.

The options shown above are valid for all the component libraries.

## Dependencies

This preset loads and combines the following packages:

| Package               | Role in this preset                        | README                                              |
| --------------------- | ------------------------------------------ | --------------------------------------------------- |
| `@tsparticles/basic`  | Base runtime bundle used by the preset     | <https://www.npmjs.com/package/@tsparticles/basic>  |
| `@tsparticles/engine` | tsParticles engine and preset registration | <https://www.npmjs.com/package/@tsparticles/engine> |

If you want to customize one specific behavior, start from the related package README above.

## Common pitfalls

- Calling `tsParticles.load(...)` before `loadStarsPreset(tsParticles)`
- Changing particle shape without loading the corresponding shape package
- The stars preset uses a dark background by default; override `background.color` if you need a different style

## Related docs

- All presets catalog: <https://github.com/tsparticles/presets>
- Color formats: <https://github.com/tsparticles/tsparticles/blob/main/markdown/Color.md>
- Main tsParticles docs: <https://particles.js.org/docs/>

---

```mermaid
flowchart TD

subgraph b [Bundles]
bb[tsParticles Basic]
end

subgraph pr [Presets]
prst[Stars]
end

bb --> prst
```

---
_Source: https://npm.io/package/@tsparticles/preset-stars · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
