GithubHelp home page GithubHelp logo

dan-lee / elements Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yamafaktory/elements

1.0 0.0 0.0 18.52 MB

Elements is a set of carefully crafted, composable React UI components, designed for the Allthings Platform.

Home Page: https://developers.allthings.me/elements/index.html

License: MIT License

JavaScript 1.24% HTML 0.03% TypeScript 98.73%

elements's Introduction

@allthings/elements

npm version Build Status Renovate enabled

Elements is a set of carefully crafted, composable React UI components, that Allthings uses to build their mobile app.

Content

Installation

Elements are available on npm package.

yarn add @allthings/elements

Please note that @allthings/elements is still under heavy development.

Usage

Here is a quick example to get you started, it's all you need:

import React from 'react'
import { render } from 'react-dom'
import Button from '@allthings/elements/molecules/Button'

function App() {
  return <Button>Hello World</Button>
}

render(<App />, document.querySelector('#app'))

Notes:

fetch

@allthings/elements uses fetch and expects it to be globally available. For example cross-fetch can be used at the entry point of the app:

import 'cross-fetch/polyfill'

Examples

Are you looking for some full example projects to get started? Check this out.

Documentation

Check out our documentation website.

Writing unit tests

Whenever you create or edit a React component or any other JavaScript file, you must update or create a corresponding test file in the same directory.

By convention the test file should be named after the file's name with an additional .test. part:

SomeDir
  | - MyButton.jsx
  | - MyButton.test.jsx
SomeOtherDir
  | - utils.js
  | - utils.test.js

To manually trigger the unit tests, run:

yarn test

You can also use the corresponding watch task:

yarn watch:test

The unit tests are performed using the Jest platform, please refer to its documentation.

React component testing is based on the Enzyme testing utility, please refer to its documentation.

The use of snapshots generated by the toMatchSnapshot() method is strongly encouraged. Those snapshots must be always commited as they are a very useful tool whenever you want to make sure your UI does not change unexpectedly

elements's People

Contributors

dan-lee avatar dmitrymarkov avatar egeogretmen avatar elvizcacho avatar fivenp avatar greenkeeper[bot] avatar hasznosl avatar herman-toothrot avatar iamn1ck avatar janrembold avatar kialysa avatar mosch avatar renovate-bot avatar renovate[bot] avatar svlapin avatar xeoxx avatar yamafaktory avatar

Stargazers

 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.