AstrolUI AstrolUI
Yellow Orange Red Green Blue Purple Custom color
Light mode
ContentInput

Gives your own fields the AstrolUI look and adds an action button to them.

1. What it is for

AstrolUI does not change your app's fields: a bare <input> looks the way the browser draws it. AstrolContentInput is the wrapper that gives them the AstrolUI look: same height as the buttons (38 px), theme border and radius, a stronger border on hover and a focus ring in the theme color while typing. It works with input, textarea, select and Blazor's components (InputText, InputNumber, InputSelect, InputTextArea...).

Click the fields in each column to see the difference:

Without AstrolContentInput
With AstrolContentInput
@using Astrol.Component.Basic.Form
 
@* Without the wrapper: the browser's own field *@
<input type="text" placeholder="Name" />
 
@* With the wrapper: AstrolUI look (border, height, radius, hover and focus ring in the theme color) *@
<AstrolContentInput>
    <input type="text" placeholder="Name" />
</AstrolContentInput>
<AstrolContentInput>
    <textarea placeholder="Comment"></textarea>
</AstrolContentInput>

2. Icon button inside the field

With Icon a button appears on the right of the field (the text leaves room for it) and OnClickIcon runs when it is pressed: clear, search, call, copy... Set IconAriaLabel for screen readers. AstrolInputPassword uses this same button to show or hide the password.

<AstrolContentInput Icon="astrol-cancel" IconAriaLabel="Clear" OnClickIcon="() => name = string.Empty">
    <input type="text" placeholder="Name" @bind="name" @bind:event="oninput" />
</AstrolContentInput>
<AstrolContentInput Icon="astrol-phone" IconAriaLabel="Call" OnClickIcon="Call">
    <input type="tel" placeholder="Phone" @bind="phone" />
</AstrolContentInput>

3. Inside an EditForm

Wrap Blazor's form components just like an input. When validation marks the field as invalid, the border turns red. FocusRing="false" removes the focus ring and HasShadow="false" the shadow, for quieter fields. Submit the empty form to see validation.

<EditForm Model="contact" OnValidSubmit="Save">
    <DataAnnotationsValidator />
    <AstrolContentInput>
        <InputText @bind-Value="contact.Email" placeholder="Email" />
    </AstrolContentInput>
    <ValidationMessage For="() => contact.Email" />
    <AstrolContentInput>
        <InputSelect @bind-Value="contact.Topic"> ... </InputSelect>
    </AstrolContentInput>
    <AstrolContentInput FocusRing="false" HasShadow="false">
        <InputTextArea @bind-Value="contact.Message" />
    </AstrolContentInput>
    <AstrolButton Type="ButtonType.Submit" Text="Save" Icon="astrol-floppy" />
</EditForm>

4. No wrapper: aui-input and aui-textarea classes

If you don't need the icon button, put the aui-input (or aui-textarea) class directly on the field and it gets the same look.

@* Same look without the wrapper (no icon button and no extra margin) *@
<input class="aui-input" placeholder="Search" />
<textarea class="aui-textarea"></textarea>
<InputText class="aui-input" @bind-Value="model.Name" />

Supported parameters

  • ChildContent (RenderFragment), field to wrap: input, textarea, select or a Blazor component (InputText, InputSelect...).
  • Icon (string), icon of the button shown on the right of the field (optional).
  • OnClickIcon (EventCallback), runs when the icon button is pressed.
  • IconAriaLabel (string), accessible text of the icon button (defaults to the app's language).
  • FocusRing (bool), focus ring in the theme color and stronger border on hover (default true). It used to be called ShowEffect.
  • HasShadow (bool), soft shadow on the field (default true).
  • Class (string), extra css class for the wrapper.
Markdown for AI © 2026 AstrolUI v10.0.13