Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@commercetools-uikit/text-input

Package Overview
Dependencies
Maintainers
3
Versions
925
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commercetools-uikit/text-input

#### Description

  • 10.24.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2K
decreased by-68.32%
Maintainers
3
Weekly downloads
 
Created
Source

TextInput

Description

A controlled text input component for single-line strings with validation states.

Usage

import { TextInput } from '@commercetools-frontend/ui-kit';

<TextInput value="foo" onChange={(event) => alert(event.target.value)} />;
Properties
PropsTypeRequiredValuesDefaultDescription
idstring---Used as HTML id property
namestring---Used as HTML name property
valuestring--Value of the input
autoCompletestring---Used as HTML autocomplete property
onChangefunc---Called with the new value. Required when input is not read only. Parent should pass it back as value
onBlurfunc---Called when field is blurred
onFocusfunc---Called when field is focused
isAutofocussedbool---Focus the input field on initial render
isDisabledbool--falseIndicates that the field cannot be used (e.g not authorised, or changes not saved)
isReadOnlybool--falseIndicates that the field is displaying read-only content
hasErrorbool---Indicates the input field has an error
hasWarningbool---Indicates the input field has a warning
placeholderstring---Placeholder text for the input
horizontalConstraintobjects, m, l, xl, scalescaleHorizontal size limit of the input fields.

The component further forwards all data- attributes to the underlying input component.

Static methods

TextInput.isEmpty

Returns true when the value is considered empty, which is when the value is empty or consists of spaces only.

TextInput.isEmpty(''); // -> true
TextInput.isEmpty(' '); // -> true
TextInput.isEmpty('tree'); // -> false

Main Functions and use cases are:

  • Input field for single-line strings

FAQs

Package last updated on 10 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc