Text input

The text input allows users to enter a single line of text, providing a customisable version of the native HTML text input

Overview

The text input component is a styled version of FormKit’s native HTML text input, supporting basic text entry, validation, and optional numeric casting.

For more detailed information on configuring and using FormKit’s text input, refer to the official FormKit text input documentation.

Basic usage

Check out the FormKit documentation in the Foundations section for setup instructions if you’re new to FormKit.

Importing the component

Ensure your application is configured to use the FormKit plugin. You can then include the text input component in your FormKit schema or as a standalone component.

Example usage

Once registered, use the text input component like this:


                                                        
                                                        
                                                            <FormKit 
                                                            type="text" 
                                                            label="Your username" 
                                                            placeholder="Enter a memorable username" 
                                                            value="calypso" 
                                                        />
                                                        
                                                            

Accessibility

The text input component is fully accessible, supporting keyboard navigation, aria attributes, and customizable labels for improved accessibility.

Internationalisation

The text input supports internationalised placeholders, labels, and validation messages, making it adaptable for global use.