GithubHelp home page GithubHelp logo

darieldejesus / rendition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from balena-io-modules/rendition

0.0 2.0 0.0 4.9 MB

A library of React UI components

Home Page: https://resin-io-modules.github.io/rendition

License: Apache License 2.0

JavaScript 55.28% HTML 0.03% TypeScript 44.69%

rendition's Introduction

Rendition

npm version Build Status Dependency Status style: styled-components

A library of UI components, built using React, recompose, styled-components and styled-system.

Usage

import React from 'react'
import ReactDOM from 'react-dom'
import { Button, Box, Provider } from 'rendition';

ReactDOM.render(
  <Provider>
    <Box my={3} mx={['auto', 15]}>
      <Button primary emphasized>Click me</Button>
    </Box>
  </Provider>,
  document.getElementById('root')
);

Demo

For an interactive demo of all components, see https://resin-io-modules.github.io/rendition

Provider

Wrap your application in the <Provider> component so that child components can correctly inherit the default theme. You can optionally provide your own theme.

Styled system

All components support styled-system attributes, allowing you to use a shorthand properties for styling components. The properties can have the properties in the form of string | number | Array<string | number>. If an array is provided, then a property is chosen based on the width of the screen. The screen width corresponds to a breakpoint set in the theme property of the Provider component, by default this is set to [32, 48, 64, 80] where each number is the screen width in ems.

Name Type Description
w ResponsiveStyle sets the width
fontSize ResponsiveStyle sets the font size
color ResponsiveStyle sets the color css property
bg ResponsiveStyle sets the background css property
m ResponsiveStyle sets the margin css property
mt ResponsiveStyle sets the margin-top css property
mr ResponsiveStyle sets the margin-right css property
mb ResponsiveStyle sets the margin-bottom css property
ml ResponsiveStyle sets the margin-bottom css property
mx ResponsiveStyle sets both the margin-right and margin-left css properties
my ResponsiveStyle sets both the margin-top and margin-bottom css properties
p ResponsiveStyle sets the padding css property
pt ResponsiveStyle sets the padding-top css property
pr ResponsiveStyle sets the padding-right css property
pb ResponsiveStyle sets the padding-bottom css property
pl ResponsiveStyle sets the padding-left css property
px ResponsiveStyle sets both the padding-right and padding-left css properties
py ResponsiveStyle sets both the padding-top and padding-bottom css properties

*ResponsiveStyle corresponds to a type of string | number | Array<string | number>

Extra components

Some components in the storybook are grouped separately under the Extra label. These components are not loaded by default as they rely on other large packages that you may not want to include in your application. If you would like to use them they can be loaded using by prefixing the component name with rendition/dist/extra/. For example to load the Markdown components you can use:

import { Markdown } from 'rendition/dist/extra/Markdown';

Unstable/Beta components

Some components in the storybook are grouped seperately under the Beta label. These components are experimental and still under development, as such their API may change without notice. They should not be used in a production application. If you would like to try them out they can be loaded using import * from 'rendition/dist/unstable'.

Developing

Clone this repository and then run:

npm ci

The interactive storybook can be launched by running:

npm run storybook

Code is automatically linted and formatted by Husky as a pre-commit hook.

The interactive storybook can be published by running:

npm run publish-storybook

Testing

npm test

Upgrading

Upgrading from 3.x to 4.x

rendition's People

Contributors

dimitrisnl avatar konmouz avatar lucianbuzzo avatar pimterry avatar resin-io-modules-versionbot[bot] avatar shou avatar thgreasi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.