---
title: Combobox Component
group: Component Gallery
---
The `Combobox` component provides an Autocomplete Input optimized for searching a List of string values, Key Value Pairs or Object Dictionary, e.g:
```html
```
Which supports populating both a single string value or multiple strings in an Array with **multiple** property.
## Auto Forms
Combobox components can also be used in [Auto Form Components](/vue/autoform) on `string` or string collection properties
with the `[Input(Type="combobox")]` [declarative UI Attribute](/locode/declarative#ui-metadata-attributes) on C# Request DTOs, e.g:
```csharp
public class ComboBoxExamples : IReturn, IPost
{
[Input(Type="combobox", Options = "{ allowableValues:['Alpha','Bravo','Charlie'] }")]
public string? SingleClientValues { get; set; }
[Input(Type="combobox", Options = "{ allowableValues:['Alpha','Bravo','Charlie'] }", Multiple = true)]
public List? MultipleClientValues { get; set; }
[Input(Type="combobox", EvalAllowableValues = "['Alpha','Bravo','Charlie']")]
public string? SingleServerValues { get; set; }
[Input(Type="combobox", EvalAllowableValues = "AppData.AlphaValues", Multiple = true)]
public List? MultipleServerValues { get; set; }
[Input(Type="combobox", EvalAllowableEntries = "{ A:'Alpha', B:'Bravo', C:'Charlie' }")]
public string? SingleServerEntries { get; set; }
[Input(Type="combobox", EvalAllowableEntries = "AppData.AlphaDictionary", Multiple = true)]
public List? MultipleServerEntries { get; set; }
}
```
Which can then be rendered with:
```html
```
**Combobox Options**
Each property shows a different way of populating the Combobox's optional values, they can be populated from a JavaScript
Object literal using `Options` or on the server with a [#Script Expression](https://sharpscript.net) where they can be
populated from a static list or from a C# class as seen in the examples referencing `AppData` properties:
```csharp
public class AppData
{
public List AlphaValues { get; set; }
public Dictionary AlphaDictionary { get; set; }
public List> AlphaKeyValuePairs { get; set; }
}
```
Which are populated on in the AppHost on Startup with:
```csharp
ScriptContext.Args[nameof(AppData)] = new AppData
{
AlphaValues = new() {
"Alpha", "Bravo", "Charlie"
},
AlphaDictionary = new()
{
["A"] = "Alpha",
["B"] = "Bravo",
["C"] = "Charlie",
},
AlphaKeyValuePairs = new()
{
new("A","Alpha"),
new("B","Bravo"),
new("C","Charlie"),
},
};
```
Which can alternatively be populated from a dynamic source like an RDBMS table.
As C# Dictionaries have an undetermined sort order, you can use a `List>` instead when you need to
display an ordered list of Key/Value pairs.