Plugin.Maui.NativeSearchBar 1.0.0

dotnet add package Plugin.Maui.NativeSearchBar --version 1.0.0
                    
NuGet\Install-Package Plugin.Maui.NativeSearchBar -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Plugin.Maui.NativeSearchBar" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Plugin.Maui.NativeSearchBar" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Plugin.Maui.NativeSearchBar" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Plugin.Maui.NativeSearchBar --version 1.0.0
                    
#r "nuget: Plugin.Maui.NativeSearchBar, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Plugin.Maui.NativeSearchBar@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Plugin.Maui.NativeSearchBar&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Plugin.Maui.NativeSearchBar&version=1.0.0
                    
Install as a Cake Tool

Plugin.Maui.NativeSearchBar

A .NET MAUI search bar that uses the search UI of each platform.

  • iOS 26+ on iPhone: The search field floats in the bottom toolbar, like Mail. When the user taps it, it moves up and docks above the keyboard.
  • iOS 26+ where the toolbar is not available (a visible tab bar, iPad, NavigationPage): A search button in the navigation bar. When the user taps it, the field expands in the same bar.
  • Earlier iOS versions and Mac Catalyst: The search field is in the navigation bar, below the title.
  • Android: A Material 3 search bar in the top app bar, in place of the page title. It is a pill with a search icon and a clear button.

On both platforms the view takes no space in the page layout when the field is in the navigation bar or app bar. Put the results in the page as usual, for example in a CollectionView.

Install

dotnet add package Plugin.Maui.NativeSearchBar

Register the handler in MauiProgram.cs:

builder
    .UseMauiApp<App>()
    .UseNativeSearchBar();

Use

<ContentPage xmlns:nsb="clr-namespace:Plugin.Maui.NativeSearchBar;assembly=Plugin.Maui.NativeSearchBar">
    <Grid RowDefinitions="Auto,*">
        <nsb:NativeSearchBar Text="{Binding SearchText}"
                             Placeholder="Search players"
                             SearchCommand="{Binding SearchCommand}"
                             IsTextPredictionEnabled="False"
                             ActivatesOnAppearing="True" />
        <CollectionView Grid.Row="1" ItemsSource="{Binding Results}" />
    </Grid>
</ContentPage>
Property Description
Text The search text. The default binding mode is two-way.
Placeholder The hint text in the empty field.
SearchCommand, SearchCommandParameter The command that runs when the user taps the search key on the keyboard.
IsTextPredictionEnabled Set to False to turn off autocorrect and suggestions. Use this for names.
AndroidPlacement AppBar (default) or Inline. iOS ignores this property.
IosPlacement Bottom (default), NavigationBarButton, or Top. Android ignores this property.
ActivatesOnAppearing Set to True to start the search and show the keyboard the first time the page opens. Use this on pages that only do search.
Event Description
TextChanged The text changed.
SearchButtonPressed The user tapped the search key on the keyboard.

Focus() starts the search and shows the keyboard. Unfocus() closes the keyboard.

On Android, BackgroundColor sets the color of the pill.

iOS placement rules

The plugin puts a UISearchController on the navigation item of the page. The placement follows these rules:

  1. If the page is not in a Shell or a NavigationPage, the plugin shows an inline UISearchBar in the layout.
  2. If IosPlacement is Bottom, the device is an iPhone with iOS 26 or later, the page is in a Shell, and no tab bar shows, the field goes into the bottom toolbar. The plugin shows the toolbar of the navigation controller while the page is visible. It hides the toolbar again when the page disappears.
  3. If IosPlacement is Top, or the iOS version is earlier than 26, the field goes below the title in the navigation bar.
  4. In all other conditions, the navigation bar shows a search button. The field expands into the navigation bar when the user taps the button.

A visible tab bar floats over the bottom toolbar. Thus, the plugin uses the navigation bar button when a tab bar shows. To get the bottom field on a page in a tab, set Shell.TabBarIsVisible="False" on the page.

A page in a NavigationPage never gets the bottom field. The NavigationPage renderer copies the toolbar items of the page into its own toolbar, and that toolbar fails on the search item.

Do not use a Shell SearchHandler on the same page. Both use the same navigation item.

Android notes

With AppBar placement, the plugin sets a bound copy of the search bar as the Shell.TitleView (or NavigationPage.TitleView) of the page. The original view stays in the layout with zero size. Bindings, the command, and the events stay on the view that you declare. If the page already has a title view, or has no app bar, the bar stays inline in the layout.

Material 3 puts search at the top of the screen. The plugin does not open a full-screen SearchView. The user types in the pill, and the page shows the results.

MAUI apps use a MaterialComponents (M2) theme by default. That theme does not define the M3 surface colors. In that condition, the plugin uses neutral M3 tones. If the app theme is M3, the plugin uses the theme colors.

Sample

The samples folder has a Shell app with four cases: bottom with the tab bar hidden, bottom with the tab bar visible, top, and a modal page with no navigation.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-android36.0 is compatible.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-ios26.0 is compatible.  net10.0-maccatalyst was computed.  net10.0-maccatalyst26.0 is compatible.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 108 11/22/2026