@cloudflare/component-input
TypeScript icon, indicating that this package has built-in type declarations

8.1.3 • Public • Published

@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;

Readme

Keywords

none

Package Sidebar

Install

npm i @cloudflare/component-input

Weekly Downloads

7,295

Version

8.1.3

License

BSD-3-Clause

Unpacked Size

243 kB

Total Files

14

Last publish

Collaborators

  • lbarthonet
  • cf-media-manager
  • jacobbednarz
  • celso
  • cf-radar
  • dash_service_account
  • g4brym
  • snigdha34
  • wrangler-publisher
  • marksteyn
  • chiminator
  • sgoodhew_cf
  • terinjokes
  • third774
  • jsteinberger
  • jasnell
  • asapzacy
  • pcostanzo
  • gregbrimble
  • geelen
  • rexscaria
  • dcruz_cf
  • xuranwang
  • jculvey
  • sejoker
  • vasturiano
  • cf-ci-write
  • segments-write
  • thibmeu
  • xortive
  • gurjinder
  • cf-ci2
  • lvalenta
  • worenga