@cloudflare/component-input

Cloudflare Input Component

Stats

StarsIssuesVersionUpdatedCreatedSize
@cloudflare/component-input
5.1.316 days ago3 years agoMinified + gzip package size for @cloudflare/component-input in KB

Readme

@cloudflare/component-input

Cloudflare Input Component

Installation

Installation with yarn is recommended


$ yarn add @cloudflare/component-input

Usage

import React from 'react';
import { Input, LabeledInput } from '../../src';

class InputComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      inputValue: 'Hello World'
    };
    this.handleChange = this.handleChange.bind(this);
  }

  handleChange(e) {
    const value = e.target.value;
    this.setState({
      inputValue: value
    });
  }

  render() {
    return (
      <div>
        <Input
          name="example"
          value={this.state.inputValue}
          onChange={this.handleChange}
        />

        <Input
          type="search"
          name="example"
          value={this.state.inputValue}
          onChange={this.handleChange}
        />

        <Input
          disabled
          name="example"
          value={this.state.inputValue}
          onChange={this.handleChange}
        />

        <LabeledInput
          label="@"
          name="example"
          value={this.state.inputValue}
          onChange={this.handleChange}
        />
      </div>
    );
  }
}

export default InputComponent;

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.