@jfrolich/react-emotion
TypeScript icon, indicating that this package has built-in type declarations

9.2.14 • Public • Published

react-emotion

The styled API for emotion and react

react-emotion exports styled which allows you to use emotion to create React components that have styles attached to them, it also exports all of emotion's exports.

For more documentation on styled, read about it and try it out in the styled docs

npm install --save emotion react-emotion
// @live
import styled, { css } from 'react-emotion'
const SomeComponent = styled('div')`
  display: flex;
  background-color: ${props => props.color};
`

const AnotherComponent = styled('h1')(
  {
    color: 'hotpink'
  },
  props => ({ flex: props.flex })
)

render(
  <SomeComponent color="#DA70D6">
    <AnotherComponent flex={1}>Some text.</AnotherComponent>
  </SomeComponent>
)

Dependencies (2)

Dev Dependencies (3)

Package Sidebar

Install

npm i @jfrolich/react-emotion

Homepage

emotion.sh/

Weekly Downloads

0

Version

9.2.14

License

MIT

Unpacked Size

30.5 kB

Total Files

16

Last publish

Collaborators

  • jfrolich