npm.io
0.0.4 • Published 5 years ago

shp-ui-lib

Licence
MIT
Version
0.0.4
Deps
5
Size
447 kB
Vulns
1
Weekly
0

shp-ui-lib

A simple and useful UI component library using typescript, react hooks, styled components

NPM JavaScript Style Guide

Intro

A simple and basic UI components library

  • Button

Installation

Run from shell npm install shp-ui-lib

Documentation

Button
Property Description Default Required
text Text to show on button Empty string false
style Button style. One of the following: primary, secondary, success, danger, warning, info, light primary false
onClick Function to execute on button click true

##Example

import { useCallback } from 'react'
import {Button} from 'shp-ui-lib'

function App() {
  const onClickCallback = useCallback(() => {
    console.log('Clicked')
  }, [])

  return (
    <div>
      <Button type='primary' text={'Primary'} onClick={onClickCallback} /> 
      <Button type='secondary' text={'Secondary'} onClick={onClickCallback} />
      <Button type='success' text={'Success'} onClick={onClickCallback} />
      <Button type='danger' text={'Danger'} onClick={onClickCallback} />
      <Button type='warning' text={'Warning'} onClick={onClickCallback} />
      <Button type='info' text={'Info'} onClick={onClickCallback} />
      <Button type='light' text={'Light'} onClick={onClickCallback} />
    </div>
  )
}

export default App

License

MIT Sharon Haim-Pour