@styled-system/should-forward-prop
Utility for filtering Styled System props with Emotion's shouldForwardProp option
Last updated 6 years ago by jxnblk .
MIT · Original npm · Tarball · package.json
$ cnpm install @styled-system/should-forward-prop 
SYNC missed versions from official npm registry.

@styled-system/should-forward-prop

Utility for filtering Styled System props with Emotion's shouldForwardProp option

npm i @styled-system/should-forward-prop
import styled from '@emotion/styled'
import {
  space,
  color,
  typography
} from 'styled-system'
import shouldForwardProp from '@styled-system/should-forward-prop'

const Box = styled('div', { shouldForwardProp })(
  space,
  color,
  typography
)

Custom Props

To exclude other custom props not included in Styled System, use the createShouldForwardProp utility.

import styled from '@emotion/styled'
import { space, color } from 'styled-system'
import { createShouldForwardProp, props } from '@styled-system/should-forward-prop'

const shouldForwardProp = createShouldForwardProp([
  ...props,
  'd',
  'x'
])

const Box = styled('div', {
  shouldForwardProp
})(props => ({
  display: props.d,
  fontWeight: props.x ? 'bold' : null,
}),
  space,
  color
)

MIT License

Current Tags

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

25 Versions

  • 5.1.5                                ...           6 years ago
  • 5.1.4                                ...           6 years ago
  • 5.1.2                                ...           7 years ago
  • 5.1.1                                ...           7 years ago
  • 5.1.0                                ...           7 years ago
  • 5.0.23                                ...           7 years ago
  • 5.0.21                                ...           7 years ago
  • 5.0.20                                ...           7 years ago
  • 5.0.18                                ...           7 years ago
  • 5.0.16                                ...           7 years ago
  • 5.0.15                                ...           7 years ago
  • 5.0.14                                ...           7 years ago
  • 5.0.12                                ...           7 years ago
  • 5.0.10                                ...           7 years ago
  • 5.0.7                                ...           7 years ago
  • 5.0.6                                ...           7 years ago
  • 5.0.5                                ...           7 years ago
  • 5.0.4                                ...           7 years ago
  • 5.0.3                                ...           7 years ago
  • 5.0.2                                ...           7 years ago
  • 5.0.1                                ...           7 years ago
  • 5.0.0                                ...           7 years ago
  • 5.0.0-12                                ...           7 years ago
  • 5.0.0-11                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 9
Last Month 12
Dependencies (3)
Dev Dependencies (0)
None

Copyright 2013 - present © cnpmjs.org | Home |