@styled-system/prop-types
Add prop types to components built with Styled System
Last updated 5 years ago by jxnblk .
MIT · Original npm · Tarball · package.json
$ npm install @styled-system/prop-types 
SYNC missed versions from official npm registry.

@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,
}

Current Tags

  • 5.1.5                                ...           latest (5 years ago)
  • 5.0.0-12                                ...           next (5 years ago)

24 Versions

  • 5.1.5                                ...           5 years ago
  • 5.1.4                                ...           5 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
Maintainers (1)
Downloads
Total 5
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE