Input Group
A text field with an icon, a short text or any view before or after the text.
Installation
bash
shellui-native add input-group
Platforms: MAUI · Avalonia. Also installs icon.
Usage
Basic
https://.com
Required
<ui:InputGroup PrefixIcon="Search" Placeholder="Search components..." />
<ui:InputGroup PrefixText="https://" SuffixText=".com" Placeholder="example" />
<ui:InputGroup PrefixIcon="Mail" Placeholder="shewart@shellui.dev" Keyboard="Email">
<ui:InputGroup.Suffix>
<ui:Badge Text="Required" Variant="Secondary" />
</ui:InputGroup.Suffix>
</ui:InputGroup><ui:InputGroup PrefixIcon="Search" Placeholder="Search components..." />
<ui:InputGroup PrefixText="https://" SuffixText=".com" Placeholder="example" />
<ui:InputGroup PrefixIcon="Mail" Placeholder="shewart@shellui.dev">
<ui:InputGroup.Suffix>
<ui:Badge Text="Required" Variant="Secondary" />
</ui:InputGroup.Suffix>
</ui:InputGroup>Not available on yet
The prefix and suffix sit inside the field's border, so the group has the same 40px height, focus ring and error state as Input. Prefix and Suffix take any view and replace the icon and text on their side.
MAUI and Avalonia
Keyboard, which picks the on-screen keyboard, is MAUI only.- On Avalonia a click on a control in the prefix or suffix (a button, say) is left to that control; a click anywhere else focuses the field.
API
| Property | Type | Default | Description |
|---|---|---|---|
Text |
string |
— | Entered text. Two-way bindable. |
Placeholder |
string |
— | Hint shown while empty. |
IsPassword |
bool |
false |
Masks the text. |
HasError |
bool |
false |
Shows the destructive border and ring. |
Keyboard |
Keyboard |
Default |
Soft keyboard to show on touch devices. MAUI only. |
PrefixIcon |
IconName |
None |
Icon before the text. |
SuffixIcon |
IconName |
None |
Icon after the text. |
PrefixText |
string |
— | Short text before the text, such as https://. |
SuffixText |
string |
— | Short text after the text, such as .com. |
Prefix |
View (MAUI) · Control? (Avalonia) |
null |
Any view before the text; replaces PrefixIcon and PrefixText. |
Suffix |
View (MAUI) · Control? (Avalonia) |
null |
Any view after the text; replaces SuffixIcon and SuffixText. |
| Event | Arguments | Description |
|---|---|---|
TextChanged |
TextChangedEventArgs |
The text changed. |
Completed |
— | Enter was pressed in the field. |