1.0.12 • Published 3 years ago

@rhizo/prop-types v1.0.12

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

@rhizo/prop-types

Add prop types to components built with Rhizo

npm i rhizo @rhizo/prop-types
import styled from 'styled-components'
import { space, color } from '@rhizo/system'
import propTypes from '@rhizo/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

Custom Props

import styled from 'styled-components'
import { space, system } from '@rhizo/system'
import propTypes, { propType } from '@rhizo/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,
}
1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago