@robbie-cook/react-components
A bunch of common react resources
Last updated a day ago by robbie-cook .
ISC · Original npm · Tarball · package.json
$ cnpm install @robbie-cook/react-components 
SYNC missed versions from official npm registry.

React Components

CircleCI GitHub package.json version

A collection of reusable UI components for React: https://www.npmjs.com/package/@robbie-cook/react-components

These components are used throughout some personal projects.

Pull requests / contributions welcome. Please send me an email to robbie@robbie.pw.

Usage

Setup

Prerequisites / Peer dependencies

Installation

Firstly, install the package (you will need to install yarn first -- (npm install -g yarn)): yarn add @robbie-cook/react-components --save

Then, you will need to wrap your root components in a ThemeContext.Provider and SiteContext.Provider provided by the package. For example,

import { ThemeContext, SiteContext } from "@robbie-cook/react-components"
...
<Container>
  <SiteContext.Provider>
    <ThemeContext.Provider>
      <App />
    </ThemeContext.Provider>
  </SiteContext.Provider>
</Container>
...

This will populate the default values for the theme. To make your own theme for the app, you can add a value when you add the provider. Make sure you use ThemeManager to merge your theme with the default.

e.g.

import { ThemeManager } from "@robbie-cook/react-components"

const MyTheme = ThemeManager.fillTheme({
  textColor: textColor,

  backgroundColor: backgroundColor,

  link: link,

  text: text,

  page: page,

  navbar: navbar,

  button: button,
})

Then, in your component:

<SiteContext.Provider value={MySiteContext}>
  <ThemeContext.Provider value={MyTheme}>
    <App />
  </ThemeContext.Provider>
</SiteContext.Provider>

After that, you can import any components you need. For example, you can run import { Button } from @robbie-cook/react-components

Notes

This project is in its very early stages. I am using it to share code between my React applications. The Providers need to be moved to redux in a new release, because they implement very poorly a Redux application.

Roadmap

  • Implement Redux with a new major release
  • Improvements to transition element & navbar
  • Gradual ThemeProvider implementation as needed across components (major version change will be needed)
  • Very gradual move to Typescript

Current Tags

  • 3.2.6-rc1                                ...           latest (a day ago)

73 Versions

  • 3.2.6-rc1                                ...           a day ago
  • 3.2.5                                ...           3 days ago
  • 3.2.4                                ...           3 days ago
  • 3.2.3                                ...           9 days ago
  • 3.2.2                                ...           2 months ago
  • 3.2.0                                ...           2 months ago
  • 3.1.14                                ...           2 months ago
  • 3.1.13                                ...           3 months ago
  • 3.1.12                                ...           3 months ago
  • 3.1.11                                ...           3 months ago
  • 3.1.10                                ...           3 months ago
  • 3.1.9                                ...           3 months ago
  • 3.1.8                                ...           3 months ago
  • 3.1.7                                ...           3 months ago
  • 3.1.6                                ...           3 months ago
  • 3.1.5                                ...           3 months ago
  • 3.1.4                                ...           3 months ago
  • 3.1.3                                ...           3 months ago
  • 3.1.2                                ...           3 months ago
  • 3.1.1                                ...           3 months ago
  • 3.1.0                                ...           3 months ago
  • 3.0.45                                ...           3 months ago
  • 3.0.44                                ...           3 months ago
  • 3.0.43                                ...           3 months ago
  • 3.0.42                                ...           3 months ago
  • 3.0.41                                ...           3 months ago
  • 3.0.40                                ...           3 months ago
  • 3.0.39                                ...           3 months ago
  • 3.0.38                                ...           3 months ago
  • 3.0.37                                ...           3 months ago
  • 3.0.36                                ...           3 months ago
  • 3.0.35                                ...           3 months ago
  • 3.0.34                                ...           3 months ago
  • 2.0.34                                ...           3 months ago
  • 2.0.33                                ...           3 months ago
  • 2.0.32                                ...           3 months ago
  • 2.0.31                                ...           3 months ago
  • 2.0.30                                ...           3 months ago
  • 2.0.29                                ...           3 months ago
  • 2.0.28                                ...           3 months ago
  • 2.0.27                                ...           3 months ago
  • 2.0.26                                ...           3 months ago
  • 2.0.25                                ...           3 months ago
  • 3.0.24                                ...           3 months ago
  • 3.0.23                                ...           3 months ago
  • 3.0.22                                ...           3 months ago
  • 3.0.21                                ...           3 months ago
  • 3.0.20                                ...           3 months ago
  • 3.0.19                                ...           3 months ago
  • 3.0.18                                ...           3 months ago
  • 3.0.17                                ...           3 months ago
  • 3.0.16                                ...           3 months ago
  • 3.0.15                                ...           3 months ago
  • 3.0.14                                ...           3 months ago
  • 3.0.13                                ...           3 months ago
  • 3.0.12                                ...           3 months ago
  • 3.0.11                                ...           3 months ago
  • 3.0.10                                ...           3 months ago
  • 3.0.9                                ...           3 months ago
  • 3.0.6                                ...           3 months ago
  • 3.0.5                                ...           3 months ago
  • 3.0.4                                ...           3 months ago
  • 3.0.3                                ...           3 months ago
  • 3.0.2                                ...           3 months ago
  • 3.0.1                                ...           3 months ago
  • 3.0.0                                ...           3 months ago
  • 1.1.0                                ...           3 months ago
  • 2.0.1                                ...           4 months ago
  • 2.0.2                                ...           4 months ago
  • 2.0.0                                ...           4 months ago
  • 1.0.5                                ...           4 months ago
  • 1.0.4                                ...           4 months ago
  • 1.0.3                                ...           4 months ago
Maintainers (1)
Downloads
Today 1
This Week 37
This Month 53
Last Day 11
Last Week 16
Last Month 6
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |