import React, { ChangeEvent } from 'react';
        
      export type TextInputProps = {
        label?: string;
        type?: 'number' | 'password' | 'text';
        value?: string;
        onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
      };
        
      function TextInput({ label, onChange, type = 'text', value }: TextInputProps) {
        return (
        <label className="TextInput block">
          {label && <span className="sr-only">{label}</span>}
          <input
          className="px-4 py-2 border border-gray-500 rounded-md w-full"
          onChange={onChange}
          placeholder={label}
          type={type}
          value={value}
          />
        </label>
        );
      }
        
      export default TextInput;

      Javascript language logo
      your recipe card header background
      formControl

      FrontendSnippets

      import React, { Component } from 'react';

      class TextInput extends Component {

      state = { label: '' };

      onChange = event => { this.setState({ label: event.target.value }); };

      render() { return ( <label className="TextInput block"> {this.state.label && <span className="sr-only">{this.state.label}</span>} <input type="text" className="TextInput py-2 border border-gray-500 rounded-md w-full" placeholder="Value" onChange={this.

      Shortcut: formControl.input

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.