# ComboBox > AstrolComboBox is an interactive component that combines a text box with a dropdown list, allowing you to select an option from a variety of elements. Whether it's for filtering options, facilitating data entry, or providing contextual selections, AstrolComboBox stands as an elegant solution to enhance the user experience, offering flexibility and efficiency in interaction. Source page: https://doc.astrolui.com/form/combo-box ## 1. Demo AstrolComboBox ```razor @using Astrol.Component.Basic.Form
Id: @person?.Id
Name: @person?.Name
Age: @person?.Age
Sex: @person?.Sex
@code { ``` ```csharp private Person? person; List list = new List { new Person { Id = 1, Name = "Juan", Age = 25, Sex = true }, new Person { Id = 2, Name = "Ana", Age = 30, Sex = false }, new Person { Id = 3, Name = "Pedro", Age = 42, Sex = true }, new Person { Id = 4, Name = "MarĂ­a", Age = 19, Sex = false }, new Person { Id = 5, Name = "Carlos", Age = 55, Sex = true } }; public class Person { public int Id { get; set; } public string Name { get; set; } = string.Empty; public int Age { get; set; } public bool Sex { get; set; } } } ``` ### Supported parameters - TItem **(object)**, option type **(required)**. - DataList **(IEnumerable)**, options to display. - Display **(Func)**, text of each option, e.g. **Display="p => p.Name"(recommended)**. - PropertyShow **(string)**, alternative to Display using the property name (supports "A.B" paths). - Value **(TItem)** / **ValueChanged**, selected item; supports **@bind-Value**. - InitialValue **(TItem)**, initial value without two-way binding. - OnChange **(EventCallback)**, raised when the selection changes; **Value** holds the item or null. - Filtrable **(bool)**, filters while typing, ignoring case and accents (default **true**). - Placeholder **(string)**, input placeholder. - HasContentInput **(bool)**, uses the **AstrolContentInput** container (default **false**). - ShowOpenIcon **(bool)**, shows the open icon on the right, **only if HasContentInput is true** (default **false**). - PropertyShowIsHtml **(bool)**, option text is HTML. **Trusted content only**: it is inserted unescaped. - NoSearchResultText **(string)**, text when there are no results (default follows the app language). - Id **(string)** and Class **(string)**, HTML id and css class. - The selection is compared with **Equals**: **Value** / **InitialValue** must be an instance from **DataList** (or TItem must override Equals, e.g. a **record**). - When **Filtrable** is **false** the input is read-only. Typing text that exactly matches an option selects it; on leaving the field, if the text does not match the selection, both the text and the selection are cleared. - Methods (via **@ref**): **ChangeValue(item)** selects an item from code and **ChangeDataList(list, selected)** replaces the options (and optionally the selection). - Keyboard: **arrows** to move, **Enter** to select and **Esc** to close. The dropdown opens upwards when there is no room below and works inside grids and modals.