# @styled-system/prop-types

> Add prop types to components built with Styled System

Latest version **5.1.5** (published 2020-02-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @styled-system/prop-types
pnpm add @styled-system/prop-types
yarn add @styled-system/prop-types
bun add @styled-system/prop-types
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.1.5 |
| Published | 2020-02-17 |
| First published | 2019-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Brent Jackson |
| Maintainers | jxnblk |

## Links

- npm: https://www.npmjs.com/package/@styled-system/prop-types
- npm.io page: https://npm.io/package/@styled-system/prop-types

## Dependencies (1)

- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2

## Recent versions

- 5.1.5 (latest) — 2020-02-17
- 5.0.0-12 (next) — 2019-06-02
- 5.1.4 — 2019-12-02
- 5.1.2 — 2019-09-11
- 5.1.1 — 2019-08-22
- 5.1.0 — 2019-08-12
- 5.0.23 — 2019-08-12
- 5.0.21 — 2019-08-08
- 5.0.20 — 2019-08-07
- 5.0.18 — 2019-07-31
- 5.0.16 — 2019-07-22
- 5.0.15 — 2019-07-15
- 5.0.14 — 2019-07-15
- 5.0.12 — 2019-06-25
- 5.0.10 — 2019-06-19
- … 9 more at https://npm.io/package/@styled-system/prop-types/versions

## README

# @styled-system/prop-types

Add prop types to components built with Styled System

```sh
npm i styled-system @styled-system/prop-types
```

```js
import styled from 'styled-components'
import { space, color } from 'styled-system'
import propTypes from '@styled-system/prop-types'

const Box = styled('div')(space, color)

Box.propTypes = {
  ...propTypes.space,
  ...propTypes.color,
}
```

## Available Type Categories

* `space`
* `color`
* `layout`
* `typography`
* `flexbox`
* `border`
* `background`
* `position`
* `grid`

See props of each category in [the reference table](https://styled-system.com/table).

## Custom Props

```js
import styled from 'styled-components'
import { space, system } from 'styled-system'
import propTypes, { propType } from '@styled-system/prop-types'

const gridGap = system({
  gap: {
    property: 'gridGap',
    scale: 'space',
    defaultScale: [0, 4, 8, 16, 32, 64, 128, 256, 512]
  }
})

const Stack = styled('div')(
  compose(space, gridGap)
)

Stack.propTypes = {
  ...propTypes.space,
  gap: propType,
}
```

---
_Source: https://npm.io/package/@styled-system/prop-types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
