2.0.2 • Published 2 years ago

react-sabi-button v2.0.2

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

SABI BUTTON

Create beauitful UI buttons with ease in React

🌈 Features

  • Tiny size
  • Clean user interface
  • Typescipt ready
  • Highly customisable
  • Custom icon support

📝 Installation

Install sabi-button with npm

  npm i react-sabi-button

💪 Usage/Examples

import { BtnStack, SabiBtn } from 'react-sabi-button'
import { MdEmail } from 'react-icons/md'

function App() {
  return (
    <BtnStack direction='row'>
      <SabiBtn size='s' leftIcon={<MdEmail />} theme='pink'>
        This is a Button
      </SabiBtn>
    </BtnStack>
  )
}

🧩 BtnStack Props

The BtnStack collects and stacks SabiBtn components, Hence can't be called without passing SabiBtn as a child component.

PropDescriptionTypedefault
borderSets the border of the BtnStackstring
heightSets the height of the BtnStackstring
minHeightSets the minHeight of the BtnStackstring
maxHeightSets the maxHeight of the BtnStackstring
minWidthSets the minWidth of the BtnStackstring
maxWidthSets the maxWidth of the BtnStackstring
widthSets the width of the BtnStackstringauto
displaySets the property of displaystringflex
directionSets property of flex-direction.stringrow
alignSets property of align-itemsstringcenter
justifyContentSets property of justify-contentstring
gridColumnsSets property of grid-template-rowsstring
gridRowsSets property of grid-template-columnsstring
whiteSpaceSets property of white-spacestring
wrapSets property of flex-wrapstring
overflowSets property of overflowstring
shadowSets property of box-shadowstring

🪄 SabiBtn Props

These props define the structure and look of the button component

PropDescriptionTypedefault
btnTypeSpecifies the button type based on structure. The specs are : solid outline glance glow faintstringglance
sizeSpecifies the size of the button. The specs are: xs s m l xlstrings
themeSpecifies the color theme of the button. The specs are: black white cool green pink orange purple yellow blue cyan blossom blossom-shade tint cream red defaultstringblue
widthSets the width of the buttonstring
fontSizeSets font-size of the buttonstring
heightSets the height of the buttonstring
leftIconAdds icon to the left side of the buttonReact.ReactNode
rightIconAdds icon to the right side of the buttonReact.ReactNode
borderRadiusSets property of border-radius of the buttonstring1.5px
shadowSets property of shadowstring
borderSets property of border to the buttonstring
transitionSets property of transition to buttonstring
onFocusFunction to trigger when button is focused on.React.FocusEventHandler<HTMLButtonElement>
onClickFunction to trigger when button is clickedReact.MouseEventHandler<HTMLButtonElement>

☛ Guide

When consuming the SabiBtn components. The following needs to be considered.

  1. To avoid bugs, The BtnStack and SabiBtn are both required to accept props as children.
  2. The btnType, theme and size props in SabiBtn component can't be an empty string. Either remove it or make use of it.
  3. Every Prop should accept required inputs
  4. "glow" btnType prop must accept "white" as theme prop

⚖️ License

MIT Etombi Maxwell

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.5

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago