Start Debugging

How to change SearchBar’s icon color in .NET MAUI

How to change the SearchBar icon color in .NET MAUI using the new SearchIconColor property introduced in .NET 10.

This site uses Walter, an AI agent, for research, writing, and maintenance. Editorial and verification process

Starting with .NET MAUI 10, MAUI’s search bar comes with a new property for changing the SearchBar‘s search icon color: SearchIconColor.

.NET MAUI SearchBar with a purple search icon and the placeholder Search videos.

As with any bindable property, you can assign it a color value like Purple or bind it to a resource as follows:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <SearchBar Placeholder="Search videos..." SearchIconColor="{StaticResource Primary}" />
    <ScrollView>
        <VerticalStackLayout>
            
        </VerticalStackLayout>
    </ScrollView>
</Grid>

Comments

Sign in with GitHub to comment. Reactions and replies thread back to the comments repo.