Skip to content

StaticInputBase

Abstract Inherits: StaticComponent

StaticInputBase is the root abstract class for every headless input-like component (text inputs, checkboxes, radios, selects). It exposes the bound ModelExpression, plus the two switches every input needs (ShowLabel and Disabled).

You usually don’t inherit from StaticInputBase directly — pick the more specific StaticInput, StaticCheckbox, StaticRadio or StaticSelect for the element you’re building.

TechGems.StaticComponents.Headless
using TechGems.StaticComponents.Headless;
namespace YourAssembly.Views.Components;
public abstract class MyInputBase : StaticInputBase { }
[HtmlAttributeName("asp-for")]
public ModelExpression? InputExpression { get; set; }

The ModelExpression resolved from the consumer-facing asp-for attribute. In the component’s Razor template you pass this to the inner element via a static-* tag helper so the original property metadata can be recovered through the doubly-wrapped expression.

AttributeValue
HTML attributeasp-for
RequiredNo
Defaultnull
[HtmlAttributeName("show-label")]
public bool ShowLabel { get; set; } = true;

Lets consumers opt-out of the inline label rendered by your component template. Default is true.

[HtmlAttributeName("disabled")]
public bool Disabled { get; set; }

A boolean that maps to the consumer-facing disabled HTML attribute, surfaced as a C# bool so your template can branch on it without having to parse strings.

ProcessAsync(TagHelperContext context, TagHelperOutput output)

Section titled “ProcessAsync(TagHelperContext context, TagHelperOutput output)”
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)

Delegates to StaticComponent.ProcessAsync, which renders the Razor partial view associated with the component.