# Form Inputs All input components extend a shared `InputBase` class that provides consistent styling, htmx validation integration, and parameter unification. When placed inside an `HtmxForm` with a `FormField`, inputs automatically attach `hx-post`, `hx-trigger="blur"`, and `hx-target` attributes for real-time per-field validation. --- ## TextInput A standard text input for strings. Supports all HTML input types (`text`, `email`, `password`, `search`, etc.). ```razor ``` ### Parameters | Parameter | Type | Default | Description | |---|---|---|---| | `Type` | `string` | `"text"` | HTML input type | | `Id` | `string?` | — | Input element ID | | `Name` | `string?` | — | Form field name (submitted to the server) | | `Value` | `string?` | — | Current value | | `Placeholder` | `string?` | — | Placeholder text | | `Disabled` | `bool` | `false` | Disables the input | | `ReadOnly` | `bool` | `false` | Makes the input read-only | | `Class` | `string?` | — | Additional CSS classes | --- ## NumberInput A numeric input with built-in increment/decrement stepper buttons. Hides the browser's native spinner. ```razor ``` ### Parameters | Parameter | Type | Default | Description | |---|---|---|---| | `Min` | `string?` | — | Minimum allowed value | | `Max` | `string?` | — | Maximum allowed value | | `Step` | `string?` | — | Step increment | | `Value` | `double?` | — | Current numeric value | Inherits all parameters from `InputBase` (`Id`, `Name`, `Placeholder`, `Disabled`, `ReadOnly`, `Class`). The stepper buttons are disabled when the value reaches `Min` or `Max`. They are hidden when `Disabled` or `ReadOnly` is true. --- ## DateInput A date picker that combines a hidden `` with a popover calendar. Users select dates through the calendar UI — the native date picker chrome is hidden. ```razor ``` ### How it works 1. A hidden `` holds the actual form value in `yyyy-MM-dd` format 2. A styled button trigger shows the selected date (or placeholder) 3. Clicking the trigger opens a `Popover` containing a `Calendar` component 4. Selecting a day updates the hidden input and closes the popover ### Parameters | Parameter | Type | Default | Description | |---|---|---|---| | `Value` | `DateOnly?` | — | Currently selected date | | `Min` | `string?` | — | Minimum date | | `Max` | `string?` | — | Maximum date | | `Placeholder` | `string?` | `"Select date"` | Trigger button placeholder | Inherits all parameters from `InputBase`. --- ## TimeInput A time picker that combines a hidden `` with a popover time picker. Features scrollable hour/minute columns and AM/PM toggle. ```razor ``` ### Parameters | Parameter | Type | Default | Description | |---|---|---|---| | `Value` | `TimeOnly?` | — | Currently selected time | | `Step` | `string?` | — | Minute step interval | | `Use12Hour` | `bool` | `true` | 12-hour format with AM/PM | | `Placeholder` | `string?` | `"Select time"` | Trigger button placeholder | Inherits all parameters from `InputBase`. --- ## DateTimeInput Combines a date picker and time picker side by side for selecting both date and time. Internally manages a hidden `` plus two helper hidden inputs for the date and time parts. ```razor ``` ### How it works 1. A hidden `` holds the combined value in `yyyy-MM-ddTHH:mm` format 2. Two helper hidden inputs hold the date-part and time-part separately 3. Two popover triggers (calendar + time picker) are displayed side by side 4. The `forms.js` module automatically combines the date-part and time-part values into the main hidden input ### Parameters | Parameter | Type | Default | Description | |---|---|---|---| | `Value` | `DateTime?` | — | Currently selected date and time | | `Min` | `string?` | — | Minimum datetime | | `Max` | `string?` | — | Maximum datetime | | `Step` | `string?` | — | Minute step interval | | `Placeholder` | `string?` | `"Select date"` | Date trigger placeholder | Inherits all parameters from `InputBase`. --- ## FormField Wraps an input with a label, description, and error placeholder. The error element is used by htmx to display server-side validation messages. ```razor ``` ### Parameters | Parameter | Type | Default | Description | |---|---|---|---| | `Label` | `string?` | — | Label text rendered as `