Socket
Book a DemoInstallSign in
Socket

cf-component-input

Package Overview
Dependencies
Maintainers
23
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-component-input

Cloudflare Input Component

latest
npmnpm
Version
7.0.0
Version published
Maintainers
23
Created
Source

cf-component-input

Cloudflare Input Component

Installation

Installation with yarn is recommended


$ yarn add cf-component-input

Usage

import React from 'react';
import { Input, LabeledInput } from 'cf-component-input';

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;

FAQs

Package last updated on 08 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts