reactlite
>
Last updated 2 years ago by lomocc .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install reactlite 
SYNC missed versions from official npm registry.

reactlite

NPM JavaScript Style Guide

Install

npm install --save reactlite

Usage

DEMO

https://codesandbox.io/s/7yqyq2q8x

Box

<Box color="red" fontSize="24px">
  24px Red Div
</Box>

Container

<Container
  smBackgroundColor="red"
  mdBackgroundColor="green"
  lgBackgroundColor="blue"
>
  media query auto change backgroundColor: Red/Green/Blue
</Container>

Layer

import React, { Component } from 'react';

import { Layer, Text } from 'reactlite';

class Example extends Component {
  render() {
    let { showLayer } = this.props;
    return (
      showLayer && (
        <Layer>
          <Text>Layer Content</Text>
        </Layer>
      )
    );
  }
}

全局 Layer

import React, { Component } from 'react';

import { Box, Button, Text, Layer } from 'reactlite';

class App extends Component {
  render() {
    return <Layer.Placeholder />;
  }
}
class Example extends Component {
  add = () => {
    this.element = <Text>Layer Content</Text>;
    Layer.mount(this.element);
  };
  remove = () => {
    Layer.unmount(this.element);
  };
  render() {
    return (
      <Box>
        <Button onClick={this.add}>add</Button>
        <Button onClick={this.remove}>remove</Button>
      </Box>
    );
  }
}

unmount self

import React, { Component } from 'react';

import { Layer } from 'reactlite';

class App extends Component {
  render() {
    return <Layer.Placeholder />;
  }
}
class Modal extends Component {
  unmount = () => {
    this.props.unmount();
  };
  render() {
    return (
      <div>
        <button onClick={this.unmount}>unmount self</button>
      </div>
    );
  }
}
class Example extends Component {
  add = () => {
    this.element = <Modal />;
    Layer.mount(this.element);
  };

  render() {
    return <button onClick={this.add}>add</button>;
  }
}

License

MIT © lomocc

Current Tags

  • 3.2.2                                ...           beta (2 years ago)
  • 3.2.30                                ...           dev (2 years ago)
  • 3.2.13                                ...           latest (2 years ago)
  • 4.0.1                                ...           next (a year ago)

75 Versions

  • 4.0.1                                ...           a year ago
  • 4.0.0                                ...           a year ago
  • 3.2.30                                ...           2 years ago
  • 3.2.29                                ...           2 years ago
  • 3.2.28                                ...           2 years ago
  • 3.2.27                                ...           2 years ago
  • 3.2.26                                ...           2 years ago
  • 3.2.25                                ...           2 years ago
  • 3.2.24                                ...           2 years ago
  • 3.2.23                                ...           2 years ago
  • 3.2.22                                ...           2 years ago
  • 3.2.21                                ...           2 years ago
  • 3.2.20                                ...           2 years ago
  • 3.2.19                                ...           2 years ago
  • 3.2.18                                ...           2 years ago
  • 3.2.17                                ...           2 years ago
  • 3.2.16                                ...           2 years ago
  • 3.2.15                                ...           2 years ago
  • 3.2.14                                ...           2 years ago
  • 3.2.13                                ...           2 years ago
  • 3.2.12                                ...           2 years ago
  • 3.2.11                                ...           2 years ago
  • 3.2.10                                ...           2 years ago
  • 3.2.9                                ...           2 years ago
  • 3.2.8                                ...           2 years ago
  • 3.2.7                                ...           2 years ago
  • 3.2.6                                ...           2 years ago
  • 3.2.5                                ...           2 years ago
  • 3.2.4                                ...           2 years ago
  • 3.2.3                                ...           2 years ago
  • 3.2.2                                ...           2 years ago
  • 3.1.6                                ...           2 years ago
  • 3.1.5                                ...           2 years ago
  • 3.1.4                                ...           2 years ago
  • 3.1.3                                ...           2 years ago
  • 3.1.2                                ...           2 years ago
  • 3.1.1                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.5                                ...           2 years ago
  • 3.0.4                                ...           2 years ago
  • 3.0.3                                ...           2 years ago
  • 3.0.2                                ...           2 years ago
  • 3.0.1                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 2.0.0                                ...           3 years ago
  • 1.2.20                                ...           3 years ago
  • 1.2.19                                ...           3 years ago
  • 1.2.17                                ...           3 years ago
  • 1.2.16                                ...           3 years ago
  • 1.2.15                                ...           4 years ago
  • 1.2.14                                ...           4 years ago
  • 1.2.13                                ...           4 years ago
  • 1.2.12                                ...           4 years ago
  • 1.2.11                                ...           4 years ago
  • 1.2.10                                ...           4 years ago
  • 1.2.9                                ...           4 years ago
  • 1.2.8                                ...           4 years ago
  • 1.2.7                                ...           4 years ago
  • 1.2.6                                ...           4 years ago
  • 1.2.5                                ...           4 years ago
  • 1.2.3                                ...           4 years ago
  • 1.2.2                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.12                                ...           4 years ago
  • 1.1.11                                ...           4 years ago
  • 1.1.9                                ...           4 years ago
  • 1.1.8                                ...           4 years ago
  • 1.1.7                                ...           4 years ago
  • 1.1.6                                ...           4 years ago
  • 1.1.5                                ...           4 years ago
  • 1.1.4                                ...           4 years ago
  • 1.1.3                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 76
Dependencies (8)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |