1.0.5 • Published 5 years ago

react-button-nice v1.0.5

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

react-button-nice

Adding hover/active effects into your buttons.

Screenshot

Demo link

Using wrapped element background-color and border-radius to generate effect.

import ButtonNice from 'react-button-nice';

const btnDefaultStyle = {
  padding: '16px 32px',
  cursor: 'pointer',
  fontSize: 16,
  color: 'white',
  border: 'none',
  borderRadius: '40px',
  outline: 'none',
  width: 300,
};

<ButtonNice>
  <button style={{ ...btnDefaultStyle, backgroundColor: '#843CC7' }}>
    Your button
  </button>
</ButtonNice>

Component props

propsdefaultdesc
wrapperColornullit disables auto-color-matching and use custom color
speed400mstransition speed
alpha0.4opacity for effect
disabledfalsedisabling wrapper and wrapped component

Tested on Chrome 70+, Firefox 63+, Opera 56+, Safari 12+, Edge 15+, IE 10+