Balance Logo
Balance
Reckon Design System

Text Field

Text inputs enable the user to interact with and input content and data.
Install
pnpm add @reckon-web/text-field
Import usage
import {
Adornment,
AdornmentWrapper,
TextInput,
TextArea,
TextAreaField,
TextField,
useInputStyles
} from '@reckon-web/text-field';
  • Code
  • API

TextField

The TextField component is the recommended component to use, which connects the label, description, and message to the input element.

Label

Each text field must be accompanied by a label. Effective form labeling helps users understand what information to enter into a text input.

Using placeholder text in lieu of a label is sometimes employed as a space-saving method. However, this is not recommended because it hides context and presents accessibility issues.

Open in Playroom

Placeholder

Placeholder text provides hints or examples of what to enter. Placeholder text disappears after the user begins entering data into the input and should not contain crucial information. Use sentence-style capitalisation, and in most cases, write the text as a direct statement without punctuation.

Description

Description text contains pertinent information that assists the user in completing a field. Description text is always visible and appears underneath the label. Use sentence-style capitalisation, and in most cases, write the text as full sentences with punctuation.

We take your privacy seriously. We will never give your email to a third party.

Help text

Help text is hidden by default, and revealed in a tooltip invoked by an icon beside the label. Reserve help text for content only relevant during the first interaction a user has with the field. Use sentence-style capitalisation, and in most cases, write the text as full sentences with punctuation.

In most cases description is preferred.

Invalid message

Offer an invalid message to inform the user how their input violates the requirements of the field.

Passing an invalid message will automatically flag the the input as invalid
Inform the user how their input violates the requirements of the field

Reserve message space

Reserve the vertical space that will be taken by an invalid message. You would use this to stop subsequent elements from being pushed down when an invalid message is displayed.

 
Element to show document "reflow" when the message appears

TextInput

The TextInput component is a styled input element and is exposed for cases where you need to implement a custom interface.

Size

There are three options for the size of the text input, "medium" is the default.

Weight

For use in data-dense interfaces you can apply a weight of "none" to hide the "chrome" of the input until the user interacts with it, on hover or focus.

TextArea

The TextArea component is a styled textarea element and is exposed for cases where you need to implement a custom interface.

TextAreaField

The TextAreaField shares the same API as the TextField component.

Copyright © 2021 Reckon. Designed and developed in partnership with Thinkmill.