stenajs-webui-core
A library of React components made by Stena IT.
Last updated a year ago by knegusen .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install stenajs-webui-core 
SYNC missed versions from official npm registry.

stenajs-webui-core

A library with common UI components for React,

Yarn

All instructions are written with Yarn as package manager. If you are using NPM, replace yarn add with npm install --save in the following instructions.

Prerequisites

It is highly recommended that you use create-react-app to setup your application. This ensure that you have a proper webpack configuration.

For more information, see https://facebook.github.io/create-react-app/.

Installation

$ yarn add stenajs-webui-core

This installs all dependencies, including two icon packs from Font Awesome that are used by components. You can install more icon packs if you need them for your project. The included ones are free-regular-svg-icons and free-solid-svg-icons.

Storybook

All components are documented in Storybook.

https://stenait.github.io/stenajs-webui-core

Run Storybook on your local machine

You can run Storybook locally by cloning the stenajs-webui-core repository and running:

yarn
yarn start

Typescript

stenajs-webui-core is developed in Typescript, and all exported components and functions are fully typed. It is recommended to use Typescript, as this will type-check your usage with the library.

create-react-app supports Typescript out of the box. Just create .ts and .tsx files in your project.

Icons

This library uses FontAwesome 5, which adds some setup steps.

1) How to install

Install any other icon packs that you want to use.

For example, add free-brands-svg-icons like this:

$ yarn add @fortawesome/free-brands-svg-icons

The icon packs free-regular-svg-icons and free-solid-svg-icons is used by stenajs-webui-core.

2) How to use

a) Explicit import

import { fab } from '@fortawesome/free-brands-svg-icons';
import {
    faCheckSquare,
    faCoffee,
} from '@fortawesome/free-solid-svg-icons';
import {
    faCheckCircle,
    faCircle,
} from '@fortawesome/free-regular-svg-icons';

const element = <Icon name={faCheckSquare} />
const element = <Icon name={faCoffee} />
const element = <Icon name={faCheckCircle} />
const element = <Icon name={faCircle} />

b) Build a Library

Create a source file, for example initFontAwesome.ts

Import library from @fortawesome/fontawesome-svg-core, and use library.add to add any icons that you want to use in your project.

import { library } from '@fortawesome/fontawesome-svg-core';
import { fab } from '@fortawesome/free-brands-svg-icons';
import {
    faCheckSquare,
    faCoffee,
} from '@fortawesome/free-solid-svg-icons';
import {
    faCheckCircle,
    faCircle,
} from '@fortawesome/free-regular-svg-icons';

library.add(
    fab,
    faCheckSquare,
    faCoffee,
    faCheckCircle,
    faCircle,
);

Then import initFontAwesome in your project.

index.tsx

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { App } from './App';
import './initFontAwesome';

ReactDOM.render(<App />, document.getElementById('root');

For more information, see https://fontawesome.com/how-to-use/on-the-web/using-with/react.

Current Tags

  • 0.9.13                                ...           latest (a year ago)

91 Versions

  • 0.9.13                                ...           a year ago
  • 0.9.12                                ...           a year ago
  • 0.9.11                                ...           a year ago
  • 0.9.10                                ...           a year ago
  • 0.9.9                                ...           a year ago
  • 0.9.8                                ...           a year ago
  • 0.9.7                                ...           a year ago
  • 0.9.6                                ...           a year ago
  • 0.9.5                                ...           a year ago
  • 0.9.4                                ...           a year ago
  • 0.9.3                                ...           a year ago
  • 0.9.2                                ...           a year ago
  • 0.9.1                                ...           a year ago
  • 0.9.0                                ...           a year ago
  • 0.9.0-alpha-17                                ...           a year ago
  • 0.9.0-alpha-16                                ...           a year ago
  • 0.9.0-alpha-15                                ...           a year ago
  • 0.9.0-alpha-14                                ...           a year ago
  • 0.9.0-alpha-13                                ...           a year ago
  • 0.9.0-alpha-12                                ...           a year ago
  • 0.9.0-alpha-11                                ...           a year ago
  • 0.9.0-alpha-10                                ...           a year ago
  • 0.9.0-alpha-9                                ...           a year ago
  • 0.9.0-alpha-8                                ...           a year ago
  • 0.9.0-alpha-7                                ...           2 years ago
  • 0.9.0-alpha-6                                ...           2 years ago
  • 0.9.0-alpha-5                                ...           2 years ago
  • 0.9.0-alpha-4                                ...           2 years ago
  • 0.9.0-alpha-3                                ...           2 years ago
  • 0.9.0-alpha-2                                ...           2 years ago
  • 0.9.0-alpha                                ...           2 years ago
  • 0.8.23                                ...           2 years ago
  • 0.8.22                                ...           2 years ago
  • 0.8.21                                ...           2 years ago
  • 0.8.20                                ...           2 years ago
  • 0.8.19                                ...           2 years ago
  • 0.8.18                                ...           2 years ago
  • 0.8.17                                ...           2 years ago
  • 0.8.16                                ...           2 years ago
  • 0.8.15                                ...           2 years ago
  • 0.8.14                                ...           2 years ago
  • 0.8.13                                ...           2 years ago
  • 0.8.12                                ...           2 years ago
  • 0.8.11                                ...           2 years ago
  • 0.8.10                                ...           2 years ago
  • 0.8.9                                ...           2 years ago
  • 0.8.8                                ...           2 years ago
  • 0.8.7                                ...           2 years ago
  • 0.8.6                                ...           2 years ago
  • 0.8.5                                ...           2 years ago
  • 0.8.4                                ...           2 years ago
  • 0.8.3                                ...           2 years ago
  • 0.8.2                                ...           2 years ago
  • 0.8.1                                ...           2 years ago
  • 0.8.0                                ...           2 years ago
  • 0.7.4                                ...           2 years ago
  • 0.7.3                                ...           2 years ago
  • 0.7.2                                ...           2 years ago
  • 0.7.1                                ...           2 years ago
  • 0.7.0                                ...           2 years ago
  • 0.6.7                                ...           2 years ago
  • 0.6.6                                ...           2 years ago
  • 0.6.5                                ...           2 years ago
  • 0.6.4                                ...           2 years ago
  • 0.6.3                                ...           2 years ago
  • 0.6.2                                ...           2 years ago
  • 0.6.1                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.6                                ...           2 years ago
  • 0.4.5                                ...           2 years ago
  • 0.4.4                                ...           2 years ago
  • 0.4.3                                ...           2 years ago
  • 0.4.2                                ...           2 years ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
  • 0.0.12                                ...           2 years ago
  • 0.0.11                                ...           2 years ago
  • 0.0.10                                ...           2 years ago
  • 0.0.9                                ...           2 years ago
  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (11)
Dev Dependencies (59)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |