• Stars
    star
    207
  • Rank 189,769 (Top 4 %)
  • Language
    TypeScript
  • License
    Apache License 2.0
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A library of React UI components

Rendition

npm version Dependency Status style: styled-components

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

Table of Contents

Installation

npm install --save rendition

Usage

Wrap your application in the Provider component and start using components!

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')
);

Components

For an interactive demo of all components, see https://balena-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.

Accessing the theme object

You can access the theme object in <Provider>'s descendant components using the useTheme hook:

import React from 'react'
import { useTheme } from 'rendition';

const MyComponent = () => {
  const theme = useTheme()

  // ...
}

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
width ResponsiveStyle sets the width
minWidth ResponsiveStyle sets the min-width
maxWidth ResponsiveStyle sets the max-width
height ResponsiveStyle sets the height
minHeight ResponsiveStyle sets the min-height
maxHeight ResponsiveStyle sets the max-height
fontSize ResponsiveStyle sets the font size
display ResponsiveStyle sets the display css property
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';

Contributing

Please read our contribution guidelines

More Repositories

1

drivelist

List all connected drives in your computer, in all major operating systems
C++
220
star
2

etcher-sdk

TypeScript
35
star
3

balena-preload

Script for preloading containers onto balena device images
Python
34
star
4

network-manager

Rust NetworkManager bindings
Rust
33
star
5

etcher-image-write

The cross-platform way to stream an OS image to a device
JavaScript
28
star
6

dockerfile-template

Process dockerfile templates, a format that allows replacing variables in Dockerfiles.
CoffeeScript
27
star
7

node-ext2fs

NodeJS native bindings to the libext2fs for cross-platform ext{2,3,4} filesystem handling.
C
26
star
8

node-lkl

NodeJS native bindings to the Linux Kernel Library project
C
26
star
9

ngUrlBind

Easily bind AngularJS scope properties to your URL hash.
CoffeeScript
20
star
10

winusb-driver-generator

A Windows Node.js native add-on to associate USB devices to the generic WinUSB driver
C++
20
star
11

electron-modal

Easily create modals using child browser windows
JavaScript
20
star
12

elevator

Windows UAC elevation that just works
JavaScript
17
star
13

openvpn-client

CoffeeScript
17
star
14

node-tunnel

TypeScript
17
star
15

open-balena-base

Shell
15
star
16

libnm-rs

WIP: libnm Rust bindings
Rust
11
star
17

persistent-tunnel

HTTP Agent for tunneling proxies with persistent sockets
TypeScript
11
star
18

device-diagnostics

on-device diagnostics tool
Shell
10
star
19

nm-api

NetworkManager DBUS API
TypeScript
9
star
20

node-docker-delta

Calculates binary diffs between docker images to speed up pull operations when keeping history is irrelevant
TypeScript
9
star
21

validateSSHjs

A js library to validate OpenSSH public keys in the client or server. Can be used to avoid sending private keys over the wire inadvertently
JavaScript
8
star
22

resin-cli-visuals

Resin CLI UI widgets.
CoffeeScript
8
star
23

balena-image-fs

Balena image filesystem manipulation utilities.
TypeScript
8
star
24

balena-compose

Complete toolkit for building docker-compose.yml files and optionally deploy them on balenaCloud
TypeScript
8
star
25

file-disk

Handling reads / writes on disk image files.
TypeScript
7
star
26

docker-progress

TypeScript
7
star
27

resin-plugin-img

Modify a resin device image before burning it.
CoffeeScript
7
star
28

scrutinizer

Extract a git repository's metadata relying on open source conventions
TypeScript
7
star
29

umd-require-webpack-plugin

JavaScript
7
star
30

livepush

Push code to your containers - live!
TypeScript
7
star
31

resin-discoverable-services

An API to allow registration and discovery of local zeroconf services
CoffeeScript
6
star
32

partitioninfo

Get information about a partition from an image file.
TypeScript
6
star
33

diskpart

Run Windows diskpart scripts in NodeJS
CoffeeScript
6
star
34

balena-compose-parse

Parse docker-compose files into a general, usable and fully typed object
TypeScript
6
star
35

mountutils

Cross platform mount related utilities
C++
6
star
36

blockmap

Tizen's block map format
TypeScript
6
star
37

nplugm

NPM based plugin framework for NodeJS.
CoffeeScript
6
star
38

balena-procbots

Process bots used for automating the development and deployment CI pipeline
TypeScript
6
star
39

network-checker

CoffeeScript
5
star
40

analytics-client

Client part of analytics services used at balena
TypeScript
5
star
41

resin-docker-build

TypeScript
5
star
42

typed-error

TypeScript
5
star
43

resin-corvus

A wrapper around Sentry and Mixpanel that works in the browser, Node and Electron.
JavaScript
5
star
44

node-metrics-gatherer

easily gather / export prometheus metrics in NodeJS
TypeScript
5
star
45

resin-plugin-hello

Learn the basics of Resin CLI plugin development
JavaScript
5
star
46

sbvr-parser

JavaScript
4
star
47

libnss-openvpn-rs

Name Service Switch plugin for OpenVPN written in Rust
Rust
4
star
48

balena-multibuild

Build docker compositions with node!
TypeScript
4
star
49

jellyschema

JellySchema - data validation, UI form generation
Rust
4
star
50

balena-release-update

Prepare and get information about the transition between two balenaCloud application releases
TypeScript
4
star
51

audio-correction

Audio stream correction utilities.
CoffeeScript
4
star
52

node-loki-grpc-client

Loki node.js GRPC clients compiled from "logproto" schema
JavaScript
4
star
53

resin-plugin-multiburn

Burn to many SDCards at the same time.
JavaScript
4
star
54

rindle

Collection of utilities for working with Streams.
JavaScript
4
star
55

balena-deploy-request

A simple script for generating deploy requests along with release notes
JavaScript
4
star
56

balena-device-config

Get device config.json configuration.
CoffeeScript
4
star
57

balena-device-status

[DEPRECATED]Balena.io device status interpreter
CoffeeScript
4
star
58

pinejs-client-js

TypeScript
4
star
59

balena-event-log

JavaScript
4
star
60

balena-device-init

Configure and initialize devices using device specs.
CoffeeScript
4
star
61

node-balena-lint

TypeScript
4
star
62

odata-parser

JavaScript
4
star
63

balena-auth

Balena session authentication utilities
TypeScript
4
star
64

balena-settings-storage

Balena settings storage utilities.
TypeScript
4
star
65

mahler

A automated task composer and HTN based planner for building autonomous system agents.
TypeScript
4
star
66

docker-storage-gc

Automatically cleanup unused images based on various cache replacement algorithms
CoffeeScript
4
star
67

conf.js

Support per-user and per-project configuration files out of the box.
CoffeeScript
4
star
68

front-sdk

An SDK for working with Front
TypeScript
4
star
69

balena-settings-client

Balena client application shared settings.
TypeScript
4
star
70

happy-eyeballs

patches NodeJS's http(s).Agent to implement "happy eyeballs 2" (rfc8305)
TypeScript
4
star
71

bmapflash

Flash an image using a `.bmap` file
JavaScript
4
star
72

sbvr-types

TypeScript
4
star
73

resin-doodles

CLI doodles, now with more unicorns!
CoffeeScript
3
star
74

rust-cross-toolchains

Rust cross compilation toolchains as Docker images
3
star
75

blinking

TypeScript
3
star
76

resin-commit-lint

JavaScript
3
star
77

denymount

Node.js library to prevent automatic mounting of specific disks on Mac OS X.
JavaScript
3
star
78

keyfctl

Library + cli for manipulating keyframes
JavaScript
3
star
79

bluebird-lru-cache

CoffeeScript
3
star
80

requestmock

CoffeeScript
3
star
81

resin-device-operations

Execute device spec operations.
CoffeeScript
3
star
82

balena-register-device

Resin.io device registration utilities.
TypeScript
3
star
83

FT2232H-56Q-openocd

C
3
star
84

dockerignore

dockerignore is a file filter library compatible with Docker and the node-ignore API
JavaScript
3
star
85

atomic-io

A library for modifying files atomically.
Rust
3
star
86

skhema

JSON Schema utility collection
JavaScript
3
star
87

resin-cli-auth

Resin.io CLI authentication handler.
CoffeeScript
3
star
88

reql-schema

ReQL to JSON Schema translator
JavaScript
3
star
89

resin-analytics

A collection of resin analytics modules
JavaScript
3
star
90

resin-device-logs

Resin.io device logs utilities.
CoffeeScript
3
star
91

balena-image-manager

Manage device base operating systems resources with caching support.
CoffeeScript
3
star
92

etcher-image-stream

THIS MODULE IS UNMAINTAINED: Get a readable stream from any type of OS image
JavaScript
3
star
93

docker-qemu-transpose

Alter a Dockerfile to allow emulated builds without binfmt
TypeScript
3
star
94

win-drive-clean

Remove a disks partition table on Windows
C++
3
star
95

resin-device-types

CoffeeScript
2
star
96

metalsmith-dynamic

Expand metalsmith page template into multiple concrete pages
CoffeeScript
2
star
97

wary

Tiny unit test framework to test code with real files.
CoffeeScript
2
star
98

musync-backend-grooveshark

MuSync Grooveshark Backend.
CoffeeScript
2
star
99

node-beaglebone-usbboot

TypeScript
2
star
100

node-qmp

Node interface for QEMU over QMP
TypeScript
2
star