5.1.5 • Published 5 years ago
@styled-system/prop-types v5.1.5
@styled-system/prop-types
Add prop types to components built with Styled System
npm i styled-system @styled-system/prop-types
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.
Custom Props
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,
}
5.1.5
5 years ago
5.1.4
6 years ago
5.1.2
6 years ago
5.1.1
6 years ago
5.1.0
6 years ago
5.0.23
6 years ago
5.0.21
6 years ago
5.0.20
6 years ago
5.0.18
6 years ago
5.0.16
6 years ago
5.0.15
6 years ago
5.0.14
6 years ago
5.0.12
6 years ago
5.0.10
6 years ago
5.0.8
6 years ago
5.0.6
6 years ago
5.0.5
6 years ago
5.0.4
6 years ago
5.0.3
6 years ago
5.0.2
6 years ago
5.0.1
6 years ago
5.0.0
6 years ago
5.0.0-12
6 years ago
5.0.0-11
6 years ago