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

0.38.0 • Public • Published

@clds/text-field


npm version

Documentation of the text field component.

Installation

Install the package using Yarn:

yarn add @clds/text-field

Components

TextField

Controlled text field component - does not handle any other responsibilities beside displaying and controlling the field itself.

Usage

import React, { FC, useRef, useState } from 'react';
import TextField from '@clds/text-field';
const ControlledExample: FC = () => {
  const [fieldValue, setFieldValue] = useState(defaultValue);
  return (
    <TextField
      onChange={setFieldValue}
      placeholder="Enter text here"
      type="text"
      value={fieldValue}
    />
  );
};
const UncontrolledExample: FC = () => {
  const textFieldRef = useRef(null);
  return <TextField defaultValue="Test" inputRef={textFieldRef} type="text" />;
};

Versioning

This library follows Semantic Versioning.

License

See LICENSE

Readme

Keywords

none

Package Sidebar

Install

npm i @clds/text-field

Weekly Downloads

1,495

Version

0.38.0

License

none

Unpacked Size

67.5 kB

Total Files

55

Last publish

Collaborators

  • cloudinary-internal