Ship faster with goilerplate templUI Pro

Input

Text field that allows users to enter and edit values.

Source Tailwind CSS JavaScript

Installation

templui add input

Load the script once in your layout:

<head>
  @input.Script()
</head>

Examples

File

Disabled

With Label

Password

Time

Time (Styled)

Form

Enter your email address for notifications.

Please enter a valid email address

API Reference

Required parameter
Hover for description

Input

Text field that allows users to enter and edit values.

Name Type Default
ID

Unique identifier for the input element.

string
-
Class

Additional CSS classes to apply to the input.

string
-
Attributes

Additional HTML attributes to apply to the input element.

templ.Attributes
-
Name

Name attribute for the form input.

string
-
Type

Input type. Options: 'text', 'password', 'email', 'number', 'tel', 'url', 'search', 'date', 'time', 'file'.

Type
text
Placeholder

Placeholder text to display when input is empty.

string
-
Value

Current value of the input field.

string
-
Disabled

Whether the input is disabled and non-interactive.

bool
false
Readonly

Whether the input is read-only.

bool
false
FileAccept

Accepted file types for file inputs (e.g., '.jpg,.png').

string
-
HasError

Whether the input has a validation error.

bool
false
NoTogglePassword

Disable password visibility toggle for password inputs.

bool
false
Axel Adrian