Miss any of our Open RFC calls?Watch the recordings here! »

@emotion/react

11.1.1 • Public • Published

@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.

Keywords

none

Install

npm i @emotion/react

DownloadsWeekly Downloads

71,640

Version

11.1.1

License

MIT

Unpacked Size

501 kB

Total Files

70

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar