Text Input
A form input component that creates a text input field with support for various HTML5 attributes, icons, and custom styling through the Uxmal Backoffice UI framework.Basic Text Input
Creates a standard text input field with a name and placeholder.
Options
The Text component supports various configuration options that can be passed to theattribute
method (e.g. attribute('placeholder', 'Enter your username')
).autocomplete
: HTML5 autocomplete attribute for form auto-fillingmaxlength
: Maximum allowed character length for the inputminlength
: Minimum required character length for the inputpattern
: Regular expression pattern for input validationplaceholder
: Placeholder text displayed when the input is emptyvalue
: Initial value of the inputicon
: Optional icon element to be displayed with the inputiconPosition
: Position of the icon ('left' or 'right')
Text Input Examples
Here are examples of different ways to use the text input component.Text Input with Validation
Creates a text input with HTML5 validation attributes for email format.
Text Input with Icon
Creates a text input with an icon positioned to the right.
Text Input with Label and Hint
Creates a text input with a label and hint text for additional guidance.
Text Input with Required
Creates a text input that is required for form submission.
Text Input with Disabled
Creates a text input that is disabled and cannot be interacted with.
Text Input with Readonly
Creates a text input that is readonly and cannot be edited.
Text Input with Custom Styling
Creates a text input with custom CSS classes and styles.
API
The text input component extends from theInput
class so it has all its methods available.Common alternative names: Text Field, Input Field, Text Box, Form Field, Input Box, Text Control
Types: Basic Text, Search Text, Password Text, Email Text, URL Text, Tel Text, Autocomplete Text, Rich Text
Principles
User Experience
Text inputs provide a simple and intuitive way for users to enter text data. They should be clearly labeled and appropriately sized for their expected content, with visual feedback for focus and validation states.
Validation
HTML5 validation attributes help ensure data quality and format conformance while providing immediate feedback to users. This reduces errors and improves data integrity.
Flexibility
Text components can be customized with various attributes, styles, and behaviors to suit different contexts and requirements while maintaining a consistent user experience.
Anatomy

- Container
- Label
- Input Element
- Icon
- Hint
- Validation Feedback
Outer wrapper div that holds all elements
Optional text label describing the input's purpose
The actual text input field
Optional icon element for visual enhancement or action
Optional helper text providing additional guidance
Visual indicators of validation status
Usage
Use text inputs for:
- Single-line text entry
- User information collection (names, emails, etc.)
- Search functionality
- Data filtering
- Configuration settings
- Form submissions
- Command entry