# Data Picker > Searchable single-select for objects, with custom templates Source: https://shellui.dev/docs/v0.3/components/form/data-picker `DataPicker` picks one object from a list, with a search box. Unlike `Select`, the value is the item itself, not a string. ## Installation ```bash shellui add data-picker ``` ## Usage ```razor

Selected: @_selected?.Name

@code { private Person? _selected; } @code { private List _people = new() { new(1, "Ada Lovelace", "Engineering"), new(2, "Grace Hopper", "Engineering"), new(3, "Katherine Johnson", "Research"), }; record Person(int Id, string Name, string Team); } ``` ## Custom templates ```razor
@context.Name @context.Team
@code { private Person? _selected; private List _people = new() { new(1, "Ada Lovelace", "Engineering"), new(2, "Grace Hopper", "Compilers"), new(3, "Alan Turing", "Research"), }; record Person(int Id, string Name, string Team); } ``` ## API Reference | Property | Type | Default | Description | |----------|------|---------|-------------| | `TItem` | `Generic type` | — | The item type | | `TKey` | `Generic type` | — | The key type returned by `KeySelector` | | `Items` | `IEnumerable` | required | Items to choose from | | `Value` | `TItem?` | `default` | Selected item (supports `@bind-Value`) | | `ValueChanged` | `EventCallback` | — | Raised when the selection changes | | `KeySelector` | `Func` | required | Unique key for each item | | `DisplaySelector` | `Func?` | `null` | Text shown for an item (defaults to `ToString()`) | | `SearchPredicate` | `Func?` | `null` | Custom search match (defaults to a case-insensitive match on the display text) | | `SelectedTemplate` | `RenderFragment?` | `null` | Custom rendering of the selected item in the trigger | | `OptionTemplate` | `RenderFragment?` | `null` | Custom rendering for each option in the list | | `Placeholder` | `string` | `"Select..."` | Text shown when nothing is selected | | `SearchPlaceholder` | `string` | `"Search..."` | Placeholder of the search box | | `EmptyText` | `string` | `"No results found."` | Text shown when the search matches nothing | | `Disabled` | `bool` | `false` | Disables the control | | `CloseOnScroll` | `bool` | `false` | Close the list when the page scrolls | | `Class` | `string?` | `null` | Additional CSS classes |