GitHub

Input

A styled text input with label, hint, clear button, password toggle, and deep ASP.NET Core model binding.

<rhx-input>

Examples

Basic

Types

With Clear Button

Password Toggle

Sizes

States

htmx Live Search

Results will appear here...

Properties

Property Type Default Description
rhx-for ModelExpression - ASP.NET Core model expression for two-way binding
name string - The form field name
value string - The current value
rhx-label string - Label text displayed above the input
rhx-hint string - Hint text displayed below the input
rhx-size string medium Input size: small, medium, large
rhx-disabled bool false Whether the input is disabled
rhx-readonly bool false Whether the input is read-only
rhx-required bool false Whether the field is required
rhx-placeholder string - Placeholder text
rhx-type string text Input type: text, email, password, number, tel, url, search, date
rhx-with-clear bool false Show a clear button when the input has a value
rhx-password-toggle bool false Show a password visibility toggle
rhx-filled bool false Use filled appearance (background instead of border)
rhx-pattern string - Regex pattern for validation
rhx-minlength int? - Minimum text length
rhx-maxlength int? - Maximum text length
rhx-min string - Minimum value for number/date types
rhx-max string - Maximum value for number/date types
rhx-step string - Step increment for number types
rhx-autocomplete string - Autocomplete hint (e.g. email, off)
rhx-autofocus bool false Whether the input receives focus on page load
aria-label string - Accessible label for the native input

Accessibility

  • Label is linked to the native <input> via for/id pairing.
  • Hint and error messages are connected via aria-describedby.
  • Error state sets aria-invalid="true" on the input.
  • Required fields set both the HTML required and aria-required="true" attributes.
  • Clear and password toggle buttons have appropriate aria-label text.