2.7.9 • Published 2 years ago

@noe-p/react-buttons-components v2.7.9

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

Installation

yarn add @noe-p/react-buttons-components

ToggleButtons

Usage

import { ToggleMenuButton } from '@noe-p/react-buttons-components';
import { useState } from 'react';

export function Button(): JSX.Element {
  const [isOpen, setIsOpen] = useState(false);
  return <ToggleMenuButton isMenuOpen={isOpen} onClick={() => setIsOpen(!isOpen)} />;
}

ToggleMenuButton

npm.io

Required Props

PropsTypeDescription
isMenuOpenbooleanBoolean to change button state
onClickfunction(value: boolean)Function to change button state

Optional Props

PropsDefaultTypeDescription
colorOpenblackstringBar colors when the menu is open
colorCloseblackstringBar colors when the menu is close
width40numberWidth and height (it’s a square) of the component (px)
spaceBetweenBars35%stringSpace between the two bars (%)
barThickness3numberBar thickness (px)
animationDuration0.3sstringAnimation duration
mobileWidth30numberMobile width and height (it’s a square) of the component (px)
mobileBarThickness2numberMobile bar thickness (px)
stylednoneCSSCustom style

ToggleTextButton

npm.io

Required Props

PropsTypeDescription
isMenuOpenbooleanBoolean to change button state
onClickfunction()Function to change button state

Optional Props

PropsDefaultTypeDescription
textOpenMenustringText when the menu is close
textCloseClosestringText when the menu is open
animationSpeed0.2numberanimation speed between character (seconds)
animationOpacity50%stringcharacter opacity dureing animaiton
fontSize25pxstringFont Size
fontFamilyserifstringFont Family
closeColorblackstringText color nwhen the menu is open
openColorblackstringText color nwhen the menu is close
animationTranslation100%stringText animation translation
mobileFontSize20pxstringFont Size on Mobile
stylenoneCSS StyleCustom css style
2.7.9

2 years ago

2.7.8

2 years ago

2.7.7

2 years ago

2.7.6

2 years ago

2.7.5

2 years ago

2.7.4

2 years ago

2.7.3

2 years ago

2.7.2

2 years ago

2.7.1

2 years ago

2.7.0

2 years ago

2.6.0

2 years ago

2.5.0

2 years ago

2.4.1

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago