# @emotion/primitives-core

> Shared utilities for emotion primitives and native

Latest version **11.13.2** (published 2024-07-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @emotion/primitives-core
pnpm add @emotion/primitives-core
yarn add @emotion/primitives-core
bun add @emotion/primitives-core
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; popular repo.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 11.13.2 |
| Published | 2024-07-29 |
| First published | 2018-07-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 43.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18019 |
| Maintainers | emmatown, tkh44, emotion-release-bot, andarist |
| Keywords | styles, emotion, react, css, css-in-js, primitives, native |

## Links

- npm: https://www.npmjs.com/package/@emotion/primitives-core
- Repository: https://github.com/emotion-js/emotion.git#main
- Homepage: https://emotion.sh
- Issues: https://github.com/emotion-js/emotion/issues
- npm.io page: https://npm.io/package/@emotion/primitives-core

## Dependencies (1)

- [css-to-react-native](https://npm.io/package/css-to-react-native.md) ^3.0.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 11.13.2 (latest) — 2024-07-29
- 11.0.0-rc.0 (rc) — 2020-10-11
- 11.0.0-next.19 (next) — 2020-10-03
- 11.13.0 — 2024-07-20
- 11.12.0 — 2024-07-19
- 11.11.0 — 2023-05-06
- 11.10.0 — 2022-07-31
- 11.0.0 — 2020-11-12
- 11.0.0-next.18 — 2020-09-20
- 11.0.0-next.17 — 2020-09-09
- 11.0.0-next.16 — 2020-09-08
- 11.0.0-next.15 — 2020-08-18
- 11.0.0-next.14 — 2020-08-01
- 11.0.0-next.13 — 2020-06-22
- 11.0.0-next.12 — 2020-03-17
- … 35 more at https://npm.io/package/@emotion/primitives-core/versions

## README

# @emotion/primitives-core

> Shared utilities for emotion primitives and native

## Introduction

> Note: In most of the cases, you won't need this package and should use `@emotion/native` or `@emotion/primitives`.

This package contains some shared utilities which are consumed by `@emotion/primitives` and `@emotion/native` for styling and rendering components.

This package provides two functions, `createCss` and `createStyled`.

### `createCss(StyleSheet)`

`createCss` accepts a platform specific `StyleSheet` method for creating styles, and returns a function which accepts styles via string template literal and object literal notation.

```js
import { StyleSheet, View, Text } from 'react-native'
import { createCss } from '@emotion/primitives-core'

const css = createCss(StyleSheet)

<View style={css`background-color: red;`}><Text style={css`font-size: 40px;`}>Hello World</Text></View>
```

### `createStyled(StyleSheet)`

`createStyled` also accepts a platform specific `StyleSheet` method for creating styles. It returns a function to which primitives can be assigned for example - `View`, `Text`, and it returns a styled component.

```js
import { StyleSheet, View, Text } from 'react-native'
import { createStyled } from '@emotion/primitives-core'

const styled = createStyled(StyleSheet)

styled.Text = styled(Text)

const StyledText = styled.Text`font-size: 40px;`

<View><StyledText>Hello World</StyledText></View>
```

---
_Source: https://npm.io/package/@emotion/primitives-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
