JSPM

  • Created
  • Published
  • Downloads 10175228
  • Score
    100M100P100Q208044F
  • License MIT

Package Exports

  • @emotion/react
  • @emotion/react/_isolated-hnrs
  • @emotion/react/jsx-dev-runtime
  • @emotion/react/jsx-runtime
  • @emotion/react/macro
  • @emotion/react/package.json
  • @emotion/react/types/css-prop

Readme

@emotion/react

Simple styling in React.

Install

yarn add @emotion/react

Usage

/** @jsx jsx */
import { jsx, css, Global, ClassNames } from '@emotion/react'

render(
  <div css={{ color: 'hotpink' }}>
    <div
      css={css`
        color: green;
      `}
    />
    <Global
      styles={{
        body: {
          margin: 0,
          padding: 0
        }
      }}
    />
    <ClassNames>
      {({ css, cx }) => (
        <div
          className={cx(
            'some-class',
            css`
              color: yellow;
            `
          )}
        />
      )}
    </ClassNames>
  </div>
)

More documentation is available at https://emotion.sh.