Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

extra-prop-types

brendon1555336MIT0.1.2TypeScript support: included

Extra PropTypes for React

react, front-end, typescript, prop-types, extra, validation, prop

readme

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


Contributors

Brendon Lees
Brendon1555
github.com/brendon1555

Support

Reach out to me at one of the following places!


License

License