11.11.0 • Published 12 months ago

@emotion/primitives v11.11.0

Weekly downloads
182
License
MIT
Repository
github
Last release
12 months ago

@emotion/primitives

Style and render primitive interfaces across multiple targets with emotion

Introduction

Emotion primitives makes it easy to style and render primitives across multiple platforms like the web, React Native and Sketch using the emotion API.

Install

npm install @emotion/primitives

or if you use yarn

yarn add @emotion/primitives

This package also depends on react, react-primitives and prop-types so make sure you've them installed.

Example

import React from 'react'
import styled, { css } from '@emotion/primitives'

import { ThemeProvider } from '@emotion/react'

const theme = {
  color: 'hotpink',
  backgroundColor: 'purple'
}

const Container = styled.View`
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 50px;
  border: 5px solid red;
  background-color: ${props => props.theme.backgroundColor};
`

const Description = styled.Text({
  color: 'hotpink'
})

const Image = styled.Image`
  padding: 40px;
`

const emotionLogo = 'https://cdn.rawgit.com/emotion-js/emotion/main/emotion.png'

class App extends React.Component {
  render() {
    return (
      <ThemeProvider theme={theme}>
        <Container
          style={css`
            border-radius: 10px;
          `}
        >
          <Description style={{ fontSize: 45, fontWeight: 'bold' }}>
            Emotion Primitives
          </Description>
          <Image
            source={{
              uri: emotionLogo,
              height: 150,
              width: 150
            }}
          />
        </Container>
      </ThemeProvider>
    )
  }
}

Supported primitives

  • Text

  • View

  • Image

11.10.6

1 year ago

11.11.0

12 months ago

11.10.0

2 years ago

11.0.0

3 years ago

11.0.0-rc.0

4 years ago

11.0.0-next.19

4 years ago

11.0.0-next.18

4 years ago

11.0.0-next.17

4 years ago

11.0.0-next.16

4 years ago

11.0.0-next.15

4 years ago

11.0.0-next.14

4 years ago

11.0.0-next.13

4 years ago

11.0.0-next.12

4 years ago

10.0.30

4 years ago

10.0.28

4 years ago

11.0.0-next.10

4 years ago

10.0.27

4 years ago

11.0.0-next.9

4 years ago

11.0.0-next.8

4 years ago

11.0.0-next.7

4 years ago

11.0.0-next.6

4 years ago

11.0.0-next.5

4 years ago

11.0.0-next.4

4 years ago

11.0.0-next.3

4 years ago

11.0.0-next.2

4 years ago

11.0.0-next.1

4 years ago

11.0.0-next.0

5 years ago

10.0.24

5 years ago

10.0.23

5 years ago

10.0.22

5 years ago

10.0.19

5 years ago

10.0.14

5 years ago

10.0.13

5 years ago

10.0.10

5 years ago

10.0.9

5 years ago

10.0.8

5 years ago

10.0.7

5 years ago

10.0.6

5 years ago

10.0.5

5 years ago

10.0.4

5 years ago

10.0.3

5 years ago

10.0.2

5 years ago

10.0.1

5 years ago

10.0.0

5 years ago

10.0.0-beta.13

5 years ago

10.0.0-beta.12

5 years ago

10.0.0-beta.11

5 years ago

10.0.0-beta.10

5 years ago

10.0.0-beta.8

5 years ago

10.0.0-beta.7

6 years ago

10.0.0-beta.6

6 years ago

10.0.0-beta.5

6 years ago

10.0.0-beta.4

6 years ago

10.0.0-beta.3

6 years ago

10.0.0-beta.2

6 years ago

10.0.0-beta.1

6 years ago

10.0.0-beta.0

6 years ago

9.2.11

6 years ago

9.2.10

6 years ago

9.2.9

6 years ago

9.2.8

6 years ago

9.2.7

6 years ago

9.2.6

6 years ago

9.2.5

6 years ago