Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crema-react-ui

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crema-react-ui

## Theme

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by250%
Maintainers
1
Weekly downloads
 
Created
Source

Crema React UI

Theme

The theme consists of all project specific units, colors, font-sizes, etc. that determine the visual properties of the UI.

Example theme definition:

const theme = {
  platform: 'native', // web, native
  color: {
    primary: 'teal',
    secondary: 'orange',
    tertiary: 'slateGray',
    highlight: 'limeGreen',
  },
  borderWidth: {
    1: 1,
    2: 3,
    3: 6,
  },
  spacing: {
    1: 2,
    2: 4,
    3: 8,
    4: 12,
    5: 16,
    6: 20,
    7: 24,
    8: 28,
    9: 32,
   10: 36,
  },
  fontSize: {
    1: 12,
    2: 14,
    3: 16,
    4: 18,
    5: 20,
    6: 22,
  },
  fontWeight: {
    1: 200,
    2: 400,
    3: 600,
  },
}

Components

Each component is built from theme aware primitives:

  • Box
  • Text
  • Grid
    • Row
    • Col

Box

Box is the base UI component. For the most part, it is a thin abstraction over the native View or div. This allows for a standard cross-platform API that ties directly into a standard theme structure while providing some conveniences (e.g. theme based spacing of child elements)

Theme Properties
  • backgroundColor [theme.color]
  • borderColor [theme.color]
  • borderWidth [theme.borderWidth]
  • borderRadius [theme.radius]
  • margin [theme.spacing]
  • opacity [theme.opacity]
  • padding [theme.spacing]
  • spacing [theme.spacing]
Convenience Properties
  • childLayout ['col', 'row'] default 'col'
  • childAlign ['start', 'end', 'center', 'stretch'] default 'stretch'
  • childWrap ['wrap', 'nowrap'] default 'nowrap'
  • childJustify ['start', 'end', 'center', 'space-between', 'space-around'] default 'start'
Standard Properties

Accepts all standard properties of View https://facebook.github.io/react-native/docs/view.html

FAQs

Package last updated on 17 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc