5.1.5 • Published 4 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
4 years ago
5.1.4
4 years ago
5.1.2
5 years ago
5.1.1
5 years ago
5.1.0
5 years ago
5.0.23
5 years ago
5.0.21
5 years ago
5.0.20
5 years ago
5.0.18
5 years ago
5.0.16
5 years ago
5.0.15
5 years ago
5.0.14
5 years ago
5.0.12
5 years ago
5.0.10
5 years ago
5.0.8
5 years ago
5.0.6
5 years ago
5.0.5
5 years ago
5.0.4
5 years ago
5.0.3
5 years ago
5.0.2
5 years ago
5.0.1
5 years ago
5.0.0
5 years ago
5.0.0-12
5 years ago
5.0.0-11
5 years ago