Sparkles

A configurable sparkles component that can be used as a background or as a standalone component.

Table of contents

  • Frankternity

PR

Installation

To install, just include the following JavaScript somewhere on your page:

<!-- Load the core file first -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/ft-core.iife.js"
></script>
<!-- Load the component -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/ft/sparkles.iife.js"
></script>

Important notes

  • Make sure your project is using either Frankenstyle or FrankenstyleKit.
  • The order of JavaScript loading is important. The ft-core.iife.js file must be loaded before any other components.
  • When using multiple Frankternity components, the core file only needs to be loaded once.

Props

To pass props, include them as JSON inside a <script> tag with the data-fn="props" attribute.

Note The data-ft-* attribute determines which Frankternity component is mounted and should be replaced with the component name.

Prop NameTypeDescription
idstringThe ID of the sparkles component
classNamestringThe class name applied to the sparkles component
stlobjectAdditional inline styles to be applied to the sparkles component.
backgroundstringThe background color of the sparkles component
particleSizenumberThe size of the particles
minSizenumberThe minimum size of the particles
maxSizenumberThe maximum size of the particles
speednumberThe speed of the particles
particleColorstringThe color of the particles
particleDensitynumberThe density of the particles