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-glassmorphic-mic-recorder

v1.0.2

Published

A stylish and functional microphone recording component for React applications, featuring a glass morphism design.

Readme

React Microphone Record Button

A stylish and functional microphone recording component for React applications, featuring a glassmorphism design.

Features

  • Start and stop audio recording
  • Display recording time
  • Audio playback
  • Download recorded audio
  • Glass morphism UI design

Installation

  1. Clone this repository or copy the component files into your React project.

  2. Install required dependencies:

npm install react-glassmorphic-mic-recorder

OR

yarn add react-glassmorphic-mic-recorder

Usage

  1. Import the component in your React application:
import ReactMicroPhoneRecordButton from 'react-microphone-record-button';
  1. Use the component in your JSX:
function App() {
  return (<div className="App">
      <h1>Audio Recorder</h1>
      <ReactMicroPhoneRecordButton />
    </div>
  );
}

Styling

The component uses a glassmorphism design. To ensure the effect works properly, add the following CSS to your project's global styles:

body {
    background: linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Arial', sans-serif;
}

The component's styles are defined in ReactMicroPhoneRecordButton.css. You can customize the appearance by modifying the CSS variables:

:root {
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --text-color: rgba(255, 255, 255, 0.8);
    --accent-blue: rgba(0, 149, 255, 0.7);
    --accent-red: rgba(255, 69, 58, 0.7);
    --accent-green: rgba(52, 199, 89, 0.7);
}

Component Structure

The component is structured as follows:

<div className="record-button-container">
    <div className="button-group">
        <button className="record-button">
            { /Record Stop button content /}
        </button>
        {/ Timer display (when recording) /}
        {/ Audio preview and download button (when recording is complete) /}
    </div>
</div>

Browser Support

This component uses the MediaRecorder API, which is supported in modern browsers. The glassmorphism effect uses backdrop-filter, which may not be supported in all browsers. Please check browser compatibility and consider fallbacks if necessary.

Customization

You can customize the component by modifying the CSS in ReactMicroPhoneRecordButton.css. The glassmorphism effect can be adjusted by changing the background, backdrop-filter, and box-shadow properties.

Known Issues

  • The backdrop-filter property used for the glassmorphism effect may not work in all browsers.
  • Ensure proper microphone permissions are granted in the browser for the recording functionality to work.

Contributing

Contributions, issues, and feature requests are welcome. Feel free to check the issues page if you want to contribute.

License

This project is open source and available under the MIT License.


Enjoy using the React Microphone Record Button! If you have any questions or need further assistance, please don't hesitate to reach out Pradeep Vishwakarma.