1.0.6 • Published 3 years ago

lancelot-animated-buttons v1.0.6

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

lancelot-animated-buttons

Animated buttoms for React.js

NPM JavaScript Style Guide

Install

npm install --save lancelot-animated-buttons

Usage

1. Animated Ellipsis button

import React from 'react'
import {LancelotEllipsisButton} from 'lancelot-animated-buttons'

const index = (props) => {
  return (
      <LancelotEllipsisButton/>
  )
}

Result

npm.io

Customization

The table below shows the properties to customize the button:

PropertyPurposeTypePossible valuesDefault
animationTimeDuration of the rotation effect after clicking in secondsnumberany positive number.5
backgroundBackground color of the buttonstringcolorsWhite
buttonSizeSize of the buttonnumber1-103
checkedButton checked or notbooleantrue/falsefalse
clickedTo call function when clickedfunctionfunctionnull
crossColorColor of the crossstringcolorsred
cursorType of cursor when hoveringstringCursor types (help, wait, pointer, grab, etc)pointer
disableHoverEffectTo disable (if true) the effect when mouse is overboolentrue/falsefalse
ellipsisColorColor of the ellipsisstringcolorsBlack
hoverEffectTimeDuration of the effect when hovering in secondsnumberany positive number.5
rotationIntensityintensity of the rotation when clickednumber1-103

Example of customization

  <LancelotEllipsisButton
    animationTime={1}
    background="#78c2fa"
    buttonSize={8}
    clicked={()=>console.log("Lancelot!")}
    crossColor="#9dfa78"
    disableHoverEffect
    ellipsisColor="red"
    rotationIntensity={10}
  />

Result

npm.io

2. Animated Hamburguer button

import React from 'react'
import {LancelotHamburguerButton} from 'lancelot-animated-buttons'

const index = (props) => {
  return (
      <LancelotHamburguerButton/>
  )
}

Result

npm.io

Customization

The table below shows the properties to customize the button:

PropertyPurposeTypePossible valuesDefault
animationTimeDuration of the rotation effect after clicking in secondsnumberany positive number.5
backgroundBackground color of the buttonstringcolorsWhite
buttonSizeSize of the buttonnumber1-103
checkedButton checked or notbooleantrue/falsefalse
clickedTo call function when clickedfunctionfunctionnull
crossColorColor of the crossstringcolorsred
cursorType of cursor when hoveringstringCursor types (help, wait, pointer, grab, etc)pointer
disableHoverEffectTo disable (if true) the effect when mouse is overboolentrue/falsefalse
hamburguerColorColor of the hamburguerstringcolorsBlack
hoverEffectTimeDuration of the effect when hovering in secondsnumberany positive number.5
rotationIntensityintensity of the rotation when clickednumber1-103

Example of customization

  <LancelotHamburguerButton
    animationTime={2}
    background="#ccc"
    buttonSize={8}
    clicked={()=>console.log("Lancelot!")}
    crossColor="#238a0e"
    disableHoverEffect
    hamburguerColor="purple"
    rotationIntensity={10}
  />

Result

npm.io

License

MIT © Elson Ramos

1.0.6

3 years ago

1.0.5

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago