# @lifeomic/prim

> Prim is a customizable TypeScript atomic styles framework for React Native.

Latest version **1.2.1** (published 2021-05-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lifeomic/prim
pnpm add @lifeomic/prim
yarn add @lifeomic/prim
bun add @lifeomic/prim
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2021-05-03 |
| First published | 2020-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 571.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | LifeOmic |
| Maintainers | lifeomicdev, npm-lifeomicdev-github |
| Keywords | tailwingcss, tailwind, react-native, react, typescript |

## Links

- npm: https://www.npmjs.com/package/@lifeomic/prim
- Repository: https://github.com/lifeomic/react-native-prim
- Homepage: https://github.com/lifeomic/react-native-prim#readme
- Issues: https://github.com/lifeomic/react-native-prim/issues
- npm.io page: https://npm.io/package/@lifeomic/prim

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2021-05-03
- 1.2.2-pr-43-1698943515-1642183280.0 (pr-43) — 2022-01-14
- 1.2.2-pr-42-1698574784-1642177193.0 (pr-42) — 2022-01-14
- 1.2.2-pr-38-936574993-1623690747.0 (pr-38) — 2021-06-14
- 1.2.2-pr-30-808288853-1620081270.0 (pr-30) — 2021-05-03
- 1.2.1-pr-29-786759323-1619466158.0 (pr-29) — 2021-04-26
- 1.2.1-pr-28-778908749-1619209427.0 (pr-28) — 2021-04-23
- 1.2.1-pr-27-713000698-1617404474.0 (pr-27) — 2021-04-02
- 1.2.1-pr-26-655341330-1615836467.0 (pr-26) — 2021-03-15
- 1.1.4-pr-25-651932554-1615746753.0 (pr-25) — 2021-03-14
- 1.1.4-pr-24-633934798-1615245082.0 (pr-24) — 2021-03-08
- 1.1.4-pr-23-619136773-1614811303.0 (pr-23) — 2021-03-03
- 1.1.4-pr-22-438856887-1608668841.0 (pr-22) — 2020-12-22
- 1.1.4-pr-21-426767280-1608158123.0 (pr-21) — 2020-12-16
- 1.1.3-pr-20-424438795-1608076189.0 (pr-20) — 2020-12-15
- … 28 more at https://npm.io/package/@lifeomic/prim/versions

## README

# react-native-prim
Prim is a customizable TypeScript atomic styles framework for React Native.

### Basics

In the root component of your screen or app:
```TypeScript
import { PrimProvider, usePrim } from '@lifeomic/prim'

const App: React.FC = () => (
  <PrimProvider>
    <RootAppNavigation />
  </PrimProvider>
)
```

In your primmly dressed components:
```TypeScript
const Title = primmed(Text, prim => [
  prim.text.xxl,
  prim.text.color.gray900,
  prim.font.bold,
])

const Body = primmed(Text, prim => [
  prim.text.base,
  prim.text.color.gray900,
  prim.font.medium,
])

const Caption = primmed(Text, prim => [
  prim.text.sm,
  prim.text.color.gray600,
  prim.font.medium,
  prim.text.capitalize,
])

const ArticleCard: React.FC<{ article: Article }> = ({ article }) => {
  const prim = usePrim()
  return (
    <View style={[
      prim.p[4],
      prim.border[1],
      prim.border.gray100,
      prim.rounded.lg,
      prim.overflow.hidden,
    ]}>
      <Caption>article.formattedDate</Title>
      <Title style={prim.mt[2]}>
        {article.title}
      </Title>
      <Body style={prim.mt[2]}>
        {article.body}
      </Title>
    </View>
  )
}
```


### Acknowledgements

Prim was inspired by [tailwindcss](https://tailwindcss.com). Much of it's API
as well as some of it's default theme will be familiar to tailwind users.

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