1.0.1 • Published 6 years ago

react-starfield-animation v1.0.1

Weekly downloads
25
License
MIT
Repository
github
Last release
6 years ago

react-starfield-animation (demo)

✨ Canvas-based starfield animation for React.

NPM Build Status JavaScript Style Guide

Demo

Install

npm install --save react-starfield-animation

Usage

Check out the demo.

import React, { Component } from 'react'

import StarfieldAnimation from 'react-starfield-animation'

class Example extends Component {
  render () {
    return (
      <StarfieldAnimation
        style={{
          position: 'absolute',
          width: '100%',
          height: '100%'
        }}
      />
    )
  }
}

Props

PropertyTypeDefaultDescription
numParticlesnumber300Number of particles (stars) to use.
lineWidthnumber2.0Line width affecting particle size.
alphaFactornumber1.0Scaling factor for particle opacity.
depthnumber300Scaling factor for particle depth.
......undefinedAny other props are applied to the root canvas element.

Note that the canvas size will automatically be inferred based on available space via react-sizeme, so it should be really easy to use this component as a fullscreen background as in the demo.

Related

License

MIT © Travis Fischer

This module was bootstrapped with create-react-library.

1.0.1

6 years ago

1.0.0

6 years ago

0.1.0

6 years ago