2.0.1 • Published 3 years ago

react-waveview v2.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

WaveView

Wave view component in React

Screenshot

wave.png

Install

npm i react-waveview --save

Get started

Example

import Wave from 'react-waveview';

const waveItems: WaveItem[] = [
  { A: 10, T: 180, fill: '#62c2ff' },
  { A: 15, T: 140, fill: '#0087dc' },
  { A: 20, T: 100, fill: '#1aa7ff' }
];

const MyComponent = () => (
  <Wave H={30} waveParams={waveItems} animated={true}></Wave>
);

Props

/**
  ---------+------------------------+
  <-- P -->|<--    T    -->|        |______
           |   /\          |   /\   |  ^
           |  /  \         |  /  \  |  A
           | /    \        | /    \ |  |
           |/      \       |/      \|__V___
           |        \      /        |  ^
           |         \    /         |  |
           |          \  /          |  |
           |           \/           |  H
           |                        |  |
           |        fill            |  |
  ---------+------------------------+__V___
*/
nametypedescriptiondefaultrequired
HnumberBaseline height-true
waveParamsWaveItem[]List of waves-true
animatedbooleanIf true, animation when mountedfalsefalse
easingTimingFunctionSpecifies the speed curve of an animationTimingFunction.LINEARfalse
speednumberBase duration in ms of one wave cycle5000false
speedIncreasePerWavenumberIncrease in speed in ms per each wave1000false
classNamestringclassName for wave container-false
styleCSSPropertiesstyle for wave container-false

Interfaces and Enums

WaveItem

nametypedescription
Anumberdistance protruding from baseline
Tnumberdistance of a wavelength
fillanybackground color of wave

TimingFunction

An enum containing all of speed curve of an animation

{
  EASE = 'ease',
  EASE_IN = 'ease-in',
  EASE_OUT = 'ease-out',
  EASE_IN_OUT = 'ease-in-out',
  LINEAR = 'linear',
  STEP_START = 'step-start',
  STEP_END = 'step-end',
}
2.0.1

3 years ago

2.0.0

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

0.0.1

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago