StaticInput
Abstract
Inherits: StaticInputBase
Section titled “ProcessAsync(TagHelperContext context, TagHelperOutput output)”
StaticInput is the headless base class for free-text <input> and
<textarea> components — text, number, date, email, password, etc. It adds
no new properties over StaticInputBase; its purpose is to be a clear
inheritance target so a UI kit can name and style text-style inputs
distinctly from checkboxes, radios and selects.
In the component’s Razor template, bind the inner <input> (or <textarea>)
via the static-for tag helper.
Namespace
Section titled “Namespace”TechGems.StaticComponents.Headlessusing TechGems.StaticComponents.Headless;
namespace YourAssembly.Views.Components;
public class PinesInput : StaticInput { }@* ~/Views/Components/PinesInput.cshtml *@@model PinesInput
@if (Model.ShowLabel){ <label static-for="@Model.InputExpression" class="…"></label>}
<input static-for="@Model.InputExpression" disabled="@(Model.Disabled ? "disabled" : null)" class="…" />@* consumer view *@<pines-input asp-for="Form.FullName"></pines-input><pines-input asp-for="Form.SignupEmail"></pines-input> @* type inferred from [DataType] *@<pines-input asp-for="Form.Password" type="password"></pines-input>Inherited Properties
Section titled “Inherited Properties”InputExpression(asp-for)ShowLabel(show-label)Disabled(disabled)
See StaticInputBase for the full descriptions.
Methods
Section titled “Methods”ProcessAsync(TagHelperContext context, TagHelperOutput output)
Section titled “ProcessAsync(TagHelperContext context, TagHelperOutput output)”public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)Delegates to StaticInputBase.ProcessAsync.
Related
Section titled “Related”- Headless Components — Feature guide.
- StaticInputBase
- StaticInputTagHelper — the
<input>tag helper used inside the template. - StaticTextAreaTagHelper — the
<textarea>tag helper used inside the template.