All Projects → mbasso → React Decoration

mbasso / React Decoration

Licence: mit
A collection of decorators for React Components

Programming Languages

javascript
184084 projects - #8 most used programming language
es7
32 projects

Projects that are alternatives of or similar to React Decoration

socket.io-react
A High-Order component to connect React and Socket.io easily
Stars: ✭ 67 (-89.55%)
Mutual labels:  decorators, react-components
Graphql Typescript
Define and build GraphQL Schemas using typed classes
Stars: ✭ 67 (-89.55%)
Mutual labels:  decorators, annotations
twc
TypeScript based, boilerplate-less, Polymer toolbox friendly Polymer Modules
Stars: ✭ 33 (-94.85%)
Mutual labels:  decorators, annotations
Sequelize Typescript
Decorators and some other features for sequelize
Stars: ✭ 2,200 (+243.21%)
Mutual labels:  decorators, annotations
soap-typescript
SOAP decorators for creating wsdl's and annotating services to provide metadata for node-soap
Stars: ✭ 20 (-96.88%)
Mutual labels:  decorators, annotations
Mobx React
React bindings for MobX
Stars: ✭ 4,814 (+651.01%)
Mutual labels:  react-components
Dokieli
💡 dokieli is a clientside editor for decentralised article publishing, annotations and social interactions
Stars: ✭ 582 (-9.2%)
Mutual labels:  annotations
Storybook Addon Material Ui
Addon for storybook wich wrap material-ui components into MuiThemeProvider. 📃 This helps and simplifies development of material-ui based components.
Stars: ✭ 513 (-19.97%)
Mutual labels:  react-components
Vue Property Decorator
Vue.js and Property Decorator
Stars: ✭ 5,156 (+704.37%)
Mutual labels:  decorators
React Vertical Timeline
Vertical timeline for React.js
Stars: ✭ 637 (-0.62%)
Mutual labels:  react-components
Swoft
🚀 PHP Microservice Full Coroutine Framework
Stars: ✭ 5,420 (+745.55%)
Mutual labels:  annotations
React Chat Elements
Reactjs chat elements chat UI, react chat components
Stars: ✭ 565 (-11.86%)
Mutual labels:  react-components
Javatutorial
Java教程,包括多线程,泛型,反射,IO,容器类,注解
Stars: ✭ 552 (-13.88%)
Mutual labels:  annotations
Cvat
Powerful and efficient Computer Vision Annotation Tool (CVAT)
Stars: ✭ 6,557 (+922.93%)
Mutual labels:  annotations
React on rails
Integration of React + Webpack + Rails + rails/webpacker including server-side rendering of React, enabling a better developer experience and faster client performance.
Stars: ✭ 4,815 (+651.17%)
Mutual labels:  react-components
Rsuite
🧱 A suite of React components .
Stars: ✭ 6,344 (+889.7%)
Mutual labels:  react-components
Multi Human Parsing
🔥🔥Official Repository for Multi-Human-Parsing (MHP)🔥🔥
Stars: ✭ 507 (-20.9%)
Mutual labels:  annotations
Light Bootstrap Dashboard React
React version of Light Bootstrap Dashboard
Stars: ✭ 561 (-12.48%)
Mutual labels:  react-components
Label Studio
Label Studio is a multi-type data labeling and annotation tool with standardized output format
Stars: ✭ 7,264 (+1033.23%)
Mutual labels:  annotations
Alosaur
Alosaur - Deno web framework with many decorators
Stars: ✭ 559 (-12.79%)
Mutual labels:  decorators

react-decoration

Build Status npm version npm downloads Coverage Status Join the chat at https://gitter.im/mbasso/react-decoration

A collection of @decorators for React Components


Attention - In order to use react-decoration you have to use babel 5 or use this plugin for babel 6. Check this page for information.


Installation

You can install react-decoration using npm:

npm install --save react-decoration

If you aren't using npm in your project, you can include reactDecoration using UMD build in the dist folder with <script> tag.

Usage

Once you have installed react-decoration, supposing a CommonJS environment, you can import decorators in this way and immediately use them with no configuration.

import React from 'react';
import { getItems } from './utils';
import { AutoComplete } from './components';
import {
  withStyles,
  debounce,
  killEvent,
  handleRenderError,
} from 'react-decoration';

@withStyles({
  container: {
    width: '100%',
    height: 'auto',
  },
  input: {
    width: 250,
  },
})
@handleRenderError((ex) => <div className="danger">{ex.message}<div>)
class SampleForm extends React.Component {

  state = {
    value: 'Hello!',
    items: [],
  }

  @debounce(500)
  handleChange(e) {
    getItems().then((response) => {
      this.setState({
        value: this.state.value,
        items: response.data.items,
      });
    });

    this.setState({
      value: e.target.value,
      items: this.state.items,
    });
  }

  @killEvent
  handleSubmit() {
    // default prevented
    // propagation stopped

    alert(`AutoComplete value is: ${this.state.value}`);
  }

  render() {
    const { styles } = this.props;
    return (
      <div style={styles.container}>
        <AutoComplete
          value={this.state.value}
          items={this.state.items}
          onChange={this.handleChange}
          style={styles.input}
        />
        <button onClick={this.handleSubmit}>
          Submit
        </button>
      </div>
    );
  }
}

Documentation

Visit docs folder to find the complete list of decorators and their usage.

Change Log

This project adheres to Semantic Versioning. Every upstream release, along with the migration instructions, is documented on the Github Releases page.

Authors

Matteo Basso

Ashley Lake

Copyright and License

Copyright (c) 2016, Matteo Basso.

react-decoration source code is licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].