Components

Text Field

A basic input field for entering short text, commonly used for forms, user input, and data entry.

Text Field

A text field is a box where you can type in text, like your name or email.

Loading...

Installation

If you hit any issues, make sure you check out the installation guide here for more information.

Composed Components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

The Text Field comes packed with several components to enhance functionality and provide a seamless experience.

Field's a core piece every other component uses. It flexes reusable styles, showing up in inputs, labels, descriptions, and more.

Manual Installation

Make sure you also install the composed components and the required packages for the component to function properly.

Anatomy

Suffix and Prefix

Enhance your TextField by adding a prefix or suffix. Whether it’s text or icons, it’s flexible to fit your design.

Loading...

Suffix with Button

Add a button to the suffix by simply including it in the suffix prop. While you can do the same with a prefix, it’s more common to see it as a suffix.

Loading...

Pending

Activate the loading state on your TextField with the isPending prop.

Loading...

Revealable

When using a text field as a password input, you may want the option to reveal the password. To enable this feature, simply add the isRevealable prop. However, ensure that the input type is explicitly set to 'password', as this is a required condition.

Loading...

Validation

In this example, we’ll ensure it’s treated as a strict requirement.

Loading...

Controlled

Manage the TextField value through the value prop for controlled usage.

Loading...

Uncontrolled

Manage the TextField value through the defaultValue prop for uncontrolled usage.

Loading...

Description

You can add a description to the text field by using the description prop.

Loading...

Readonly

Set the TextField to readonly, preventing any edits.

Loading...

Disabled

When the TextField is disabled, it becomes non-editable and appears inactive.

Loading...

Get premium Blocks

Create stunning, professional-grade layouts that not only save time but also elevate the quality of your projects.