0.1.2 • Published 4 years ago

extra-prop-types v0.1.2

Weekly downloads
15
License
MIT
Repository
github
Last release
4 years ago

Extra Prop Types

Extra Prop Types for React Components

GitHub issues devDependencies peerDependencies License


Installation

$ yarn add extra-prop-types

or

$ npm install --save extra-prop-types

Usage

import * as ExtraPropTypes from 'extra-prop-types';


const SomeComponent = (colorProp) => (
    <div style={{ backgroundColor: colorProp }}></div>
)

SomeComponent.propTypes = {
    colorProp: ExtraPropTypes.color.isRequired
}

Types

color accepts:

  • hex
    • #ffffff
  • rgb
    • rgb(255, 255, 255)
  • rgba
    • rgba(255, 255, 255, 1)
  • hsl
    • hsl(0, 100%, 100%)
  • hsla
    • hsla(0, 0%, 100%, 1)

Contributing

Want to add a type? To get started...

Step 1

  • Option 1

    • 🍴 Fork this repo!
  • Option 2

    • 👯 Clone this repo to your local machine using https://github.com/brendon1555/extra-prop-types.git

Step 2

  • HACK AWAY! 🔨🔨🔨

Step 3

  • 🔃 Create a new pull request using https://github.com/brendon1555/extra-prop-types/compare/.

Contributors

Brendon Lees
Brendon1555
github.com/brendon1555

Support

Reach out to me at one of the following places!

  • Website at brendon1555.com
  • Twitter at @brendon1555

License

License