npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-pulser

v1.0.9

Published

Frequency graph emulator to display during audio playbacks

Downloads

25

Readme

React-Pulser

Description

React component which displays an animated frequency graph. Adds a nice touch to audio playback UI's.

  • npm install --save react-pulser
import React, { Component } from 'react';
import Pulser from "react-pulser";
import "./index.css";

export default class App extends Component {
    constructor(props) {
        super(props);
        this.state = {
            playing: false
        }
        this.handleClick = this.handleClick.bind(this);
    }
    handleClick(e) {
        this.setState(prevState => {
            return {
                playing: !prevState.playing
            }
        })
    }
    render() {
        let { playing } = this.state
        return (
            <div className="app-wrapper">
                <button onClick={this.handleClick} >Play/Pause</button>
                <Pulser animate={playing} ></Pulser>
            </div>
        )
    }
}

react-pulser demo

  • NOTE: The <Pulser> component fills its parent container by default. Make sure it has a specified height and has position set to relative or it may not display. See the Props section below for more information on how to use custom styling.

Props:

Name | Type | Default | Description ----- | ------- | ----- | ------- animate | boolean | false | Toggles bar graph animation. pulserStyles | object | {} | Style object for the outer container. Use this if you want to override the default CSS styling. You can also refer to the selector .pulser-wrapper in CSS. barStyles | object | {} | Style object for individual bars. Use this if you want to override the default CSS styling. You can also refer to the selector .bar in CSS. options | object | {} | The options prop is an object which contains several extra configuration settings. See below.

Options prop
let options = {
    barQuant: 7,
    minHeight: 15,
    changeRate: 5
}
<Pulser animate options={options}>

Name | Type | Default | Description ----- | ------- | ----- | ------- barQuant | number | 5 | Specifies number of bars to display. minHeight | number | 30 | Specifies the minimum initial height of each bar in terms of the percentage of its parent container. Must be between 0 and 30. changeRate | number | 15 | Specifies the number in milliseconds for how fast to animate.