Prop Types

Add Prop Types on your declarative components.

@xstyled/prop-types exposes a utility to generate prop-types from a system prop utility.

Installation

npm i @xstyled/prop-types

Usage

getSystemPropTypes let you get prop types from a system utility.

import styled from 'styled-components' import { compose, space, color } from '@xstyled/system' import { getSystemPropTypes } from '@xstyled/prop-types' const customSystem = compose(space, color) const SystemBox = styled.div` ${customSystem} ` SystemBox.propTypes = getSystemPropTypes(customSystem)
Edit this page on GitHub