0.8.63 • Published 6 years ago

mooskin v0.8.63

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Demo

Component Playground...

Prerequisites

Since it is a React Component Library, we recommend that you get to know React before using MooSkin. Webpack is recommended as well, but any build tool that can handle importing css will work too.

Installation

MooSkin-UI is available as an npm package.

npm install mooskin --save

Usage

Apart from React itself, you need to be able to import the CSS file for the library by using a loader or some plugin for your build tool of choice(css-loader if you re using webpack, which is recommended).

import 'mooskin/lib/index/style.css'

and then you can simply import the desired component and start using it

import {Input} from 'mooskin';

Modular usage is also possible for both css and js(components) files, if you just want to use a few components, you should not have to import the whole CSS file, but instead have just what you need.

import 'mooskin/lib/Button/style.css';
import Button from 'mooskin/lib/Button';
// import {Button} from 'mooskin';  //this works as well

Example

import 'mooskin/lib/index/style.css'

import React, {Component} from 'react';
import ReactDOM from 'react-dom';

import {Button} from 'mooskin';

class App extends Component (
  render(){
    return (
      <div>
        <Button>Click me!</Button>
      </div>
    );
  }
);

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

Please refer to each component's documentation page to see how they should be imported.

Usage with Typescript

Mooskin itself is written in Typescript, so it has type definitions out of the box, no need to install any. Just import stuff as usual. Static types should greatly help with potential bugs and autocompletion. Here is an example below.

import 'mooskin/lib/index/style.css'

import * as React from 'react';
import * as ReactDOM from 'react-dom';

import {Button} from 'mooskin';

interface IProps {
  //some prop types
}

interface IState {
  //some state types
}

class App extends React.Component<IProps, IState> (
  render(){
    return (
      <div>
        <Button>Click me!</Button>
        <Button value="asdads">Click me!</Button> //compiler error because attribute 'value' does not exist in Button component
      </div>
    );
  }
);

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

If the compiler complains about the css file import, you can add a type declaration for the css import in a declaration file(.d.ts) .You can place this file in the root folder, newer versions of Typescript will pick it up automatically, otherwise you would need a ///<reference path="..."/> statement at the top of your index file.

declare module '*.css' {
  const content: any;
  export default content;
}

Other Examples

As you may have noticed, for easy use, the components are named similar to normal HTML components but with a capital first letter.

Lets say we want to use the Select Component. First we have to import it

import {Select, Option} from 'mooskin';

And then you can simply start using it by typing

<Select dataLabel="countries" onChange={callback}>
    <Option whatever>England</Option> 				//<Select.Option whatever>England</Option> //this works too
    <Option whatever>Germany</Option>
</Select>

The components are built to support attributes like normal HTML elements. For example, an Input component with a placeholder:

import {Input} from 'mooskin'

<Input placeholder="Your Name" />

List of Components

Charts

Playground (development)

Clone the Mooskin repository first. Then install dependencies with

npm install

or

yarn install

After installation run start-development.bat on the Mooskin root folder, wait for build to complete then go to http://localhost:8080/. Have fun playing with the components.

If you want to add a new component that is in development to the playground, create an example component in /playground/examples/ which returns a component in development. Add the example to /playground/App.tsx and you're good to go.

Contribute

MooSkin-UI came to life because of the love for React, and if you share the same love, we'd greatly appreciate any contribution you make.

License

This project is licensed under the terms of the MIT License

0.8.63

6 years ago

0.8.62

6 years ago

0.8.61

6 years ago

0.8.60

6 years ago

0.8.59

6 years ago

0.8.58

6 years ago

0.8.57

6 years ago

0.8.56

6 years ago

0.8.55

6 years ago

0.8.54

6 years ago

0.8.53

6 years ago

0.8.52

6 years ago

0.8.51

6 years ago

0.8.50

6 years ago

0.8.49

6 years ago

0.8.48

6 years ago

0.8.47

6 years ago

0.8.46

6 years ago

0.8.45

6 years ago

0.8.44

6 years ago

0.8.43

6 years ago

0.8.42

6 years ago

0.8.41

6 years ago

0.8.40

6 years ago

0.8.39

6 years ago

0.8.38

6 years ago

0.8.37

6 years ago

0.8.36

6 years ago

0.8.35

6 years ago

0.8.34

6 years ago

0.8.33

6 years ago

0.8.32

6 years ago

0.8.31

6 years ago

0.8.30

6 years ago

0.8.29

6 years ago

0.8.28

6 years ago

0.8.27

6 years ago

0.8.26

6 years ago

0.8.25

6 years ago

0.8.24

6 years ago

0.8.23

6 years ago

0.8.22

6 years ago

0.8.21

6 years ago

0.8.20

6 years ago

0.8.19

6 years ago

0.8.18

6 years ago

0.8.17

6 years ago

0.8.16

6 years ago

0.8.15

6 years ago

0.8.14

6 years ago

0.8.13

6 years ago

0.8.12

7 years ago

0.8.11

7 years ago

0.8.10

7 years ago

0.8.9

7 years ago

0.8.8

7 years ago

0.8.7

7 years ago

0.8.6

7 years ago

0.8.5

7 years ago

0.8.4

7 years ago

0.8.3

7 years ago

0.8.2

7 years ago

0.8.0

7 years ago

0.7.12

7 years ago

0.7.11

7 years ago

0.7.10

7 years ago

0.7.9

7 years ago

0.7.8

7 years ago

0.7.6

7 years ago

0.7.5

7 years ago

0.7.4

7 years ago

0.7.3

7 years ago

0.7.2

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago