@crave/farmblocks-input-text

5.1.14 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @crave/farmblocks-input-text

Weekly Downloads

4

Version

5.1.14

License

MIT

Unpacked Size

11.5 kB

Total Files

9

Last publish

Collaborators

  • viniciusmartin
  • luis.nascimento
  • seocam
  • vnakamura
  • alcferreira
  • imwra