@crave/farmblocks-input-text

A form field to input simple text

Stats

StarsIssuesVersionUpdatedCreatedSize
@crave/farmblocks-input-text
20235.1.12a month ago4 years agoMinified + gzip package size for @crave/farmblocks-input-text in KB

Readme

Farmblocks Text Input

A form field to input simple text

Installation

npm install @crave/farmblocks-input-text

Usage

import React, { Component } from "react";
import { render } from "react-dom";
import TextInput, { TextAreaInput } from "@crave/farmblocks-input-text";

const root = document.createElement("div");
document.body.appendChild(root);

render(
  <div>
    <TextInput label="Text Field" placeholder="enter a text..." />
    <TextInput disabled label="Disabled Field" placeholder="disabled field" />
    <TextInput
      label="Number Field"
      type="number"
      placeholder="enter a number"
    />
    <TextAreaInput label="Text area input" rows="4" />
  </div>,
  root,
);

This component uses the html input element. So the APIs are very similar.

For example, value, placeholder, disabled, maxLength, onChange and others not listed here, should work as expected, you can assume that the property will be forwarded to the core html input element. Ref.: MDN <input>

For more examples and details on the available props, read the docs.

License

MIT

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.