Tutorial
Insert SearchBox component anywhere in your razor code by writing it's tag:
razor
<SearchBox />
In order for code to be run, the component require 2 parameters to be set: T
and ItemsSource
.
T
parameter is used to specify type of data. It can be set to any custom type:
razor
<SearchBox T="Person" ItemsSource="Contacts" />
or to any standard type such as string
:
razor
<SearchBox T="string" ItemsSource="Countries" />
razor
<SearchBox T="string" ItemsSource="Products" @bind-Tags="Tags" Placeholder="E.g. onion, fish etc." />