1.1.4 • Published 10 months ago

brgndy-react-metronome v1.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

brgndy-react-metronome

React Metronome Library Component

installing

npm install brgndy-react-metronome

Usage

Import components

import { Metronome } from 'brgndy-react-metronome';

export default function Component() {
  return (
    <Metronome>
      <Metronome.BPMInput />
      <Metronome.Button />
    </Metronome>
  );
}

Metronome Props

NameDatatypeDefaultDescription
minBpmnumber or undefined1Sets the minimum BPM (Beats Per Minute) for the metronome. The default value is 1.
maxBpmnumber or undefined300Sets the maximum BPM for the metronome. The default value is 300.
autoPlayboolean or undefinedfalseDetermines whether the metronome should automatically start playing when the component is mounted. The default value is false.
onEndCount() => void or undefined() => {}Callback function that is called when the metronome reaches the last beat. The default value is an empty function.
maxBeatCountnumber or undefined4Sets the maximum number of beats per measure. For example, setting it to 4 means the metronome operates in 4/4 time. The default value is 4.

Explanation

- minBpm

Defines the minimum BPM that the metronome can be set to. This ensures that the BPM is not set to an excessively low value.

- maxBpm

Defines the maximum BPM that the metronome can be set to, preventing it from being set too high.

- autoPlay

When this prop is set to true, the metronome will automatically start playing as soon as the component is rendered, eliminating the need for manual intervention.

- onEndCount

This callback function is executed when the metronome reaches the maxBeatCount. It allows you to perform specific actions when the metronome finishes a measure.

- maxBeatCount

Determines the number of beats in each measure. For example, setting it to 4 makes the metronome operate in 4/4 time, while setting it to 3 would mean 3/4 time.

Metronome Input Component Props

NameDatatypeDefaultDescription
typenumber or rangenumberThe style you want to apply BPM style. Can choose number or range
classNamestring or undefined""className you want to apply that component.

Metronome Button Component Props

NameDatatypeDefaultDescription
buttonTextsstring, string"재생", "일시정지"texts you want to insert. if the metronome is playing, component shows buttonTexts1. and if the metronome is not playing, component shows buttonTexts0
classNamestring or undefined""className you want to apply that component.

Author

License

it's MIT License

1.1.1

11 months ago

1.1.0

11 months ago

1.1.4

10 months ago

1.1.3

10 months ago

1.1.2

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago