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

4.9.0 • Public • Published

MaterialTextInput component

State

Usage

Import like this:

import { MaterialTextInput } from '@tdcerhverv/text-input';

This component can be used as a single line Text Field, a flexible Multiline input, or a larger Text Area:

//1. Single Line:
<MaterialTextInput />

//2. Multiline:
<MaterialTextInput multiline />

//3. Text Area:
<MaterialTextInput multiline rows={numberOfRows} />

Props

All standard input props work, and then these as well:

labelText?: string;
error?: string | boolean;
hideValidation?: boolean;
validateBeforeFocus?: boolean;
loading?: boolean;
showClearIndicator?: boolean;
assistiveText?: string;
characterLimit?: number;
characterLimitErrorMsg?: string;
ref?: React.Ref<HTMLInputElement>;

Additionally, as this component is built upon a Material-UI TextField component, all standard props for that component are accepted. In particular, the multiline and rows props are used as detailed above in usage.

Tags

text-input, input, textarea, form, forms

TextInput component

State

Usage

Import like this:

import { TextInput } from '@tdcerhverv/text-input';

Props

All standard input props work, and then these as well:

interface TextInputProps extends InputHTMLAttributes<HTMLInputElement> {
  labelText?: string;
  error?: string | boolean;
  hideValidation?: boolean;
  loading?: boolean;
  ref?: React.Ref<HTMLInputElement>;
}

Tags

text-input

Readme

Keywords

none

Package Sidebar

Install

npm i @tdcerhverv/text-input

Weekly Downloads

5

Version

4.9.0

License

Apache-2.0

Unpacked Size

76.7 kB

Total Files

12

Last publish

Collaborators

  • antongb
  • dev_jonas
  • jeppebenjaminsen
  • ahhah
  • abdok
  • mikkv
  • clausr1990
  • tdc-sigbe
  • mdige
  • nuudaybot
  • tdc-olila
  • jeroen.dk.nl
  • renand
  • stegr
  • m84100
  • m92212
  • m87979
  • vertic
  • rasladev
  • muddz
  • tajsonik
  • linnt
  • molg