1.0.12 • Published 2 years ago

@rhizo/prop-types v1.0.12

Weekly downloads
-
License
MIT
Repository
-
Last release
2 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

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago