🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

starfield-react

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

starfield-react

A react component that draws a starfield on a canvas element.

1.0.0
Source
npm
Version published
Weekly downloads
33
-54.79%
Maintainers
1
Weekly downloads
 
Created
Source

Starfield

A react component that draws a starfield in a canvas element.

Using the starfield is just like a regular React component from npm:

  • npm install starfield-react --save

  • Add it to your React app:

import {render} from 'react-dom'
import {Starfield} from 'starfield-react'

render(<Starfield/>, document.querySelector('body'))

The default Starfield will look like:

Default starfield render

See the demo app for more examples in demo/src/index.js.

The component has configurable through standard propTypes documented below, they let you achieve effects like this:

starRatio={1}

starSize={10}

speed={13}starStyle={randomColor}

Exapander component

React propTypes

The total number of stars to draw in the starfield.

count: React.PropTypes.number

The speed at which the stars travel, resulting in longer lines as pseudo motion blur.

speed: React.PropTypes.number

The interval rate at which the canvas draws

interval: React.PropTypes.number

The size of the stars to draw

starSize: React.PropTypes.number

The width of the canvas element

width: React.PropTypes.number

The height of the canvas element

height: React.PropTypes.number

The css style given to the stars in the canvas strokeStyle api, eg: rgb(0,255,0)

starStyle: React.PropTypes.string

The background canvas fillStyle, eg: rgb(0,0,0)

bgStyle: React.PropTypes.string

Keywords

react-component

FAQs

Package last updated on 04 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts