Combobox
View OriginalA combobox is an input widget with an associated popup that enables users to select a value from a collection of possible values.
Goshtoso Component
Go + TemplSingle Select
- No matches found
Single Select with Search
- No matches found
Multi-Select with Checkboxes
- No matches found
Multi-Select with Search
- No matches found
With Images
- No matches found
Pre-selected Values
- No matches found
Disabled State
- No matches found
Usage Example
// Simple Single-Select
@combobox.Combobox(combobox.Config{
ID: "industry",
Label: "Industry",
Placeholder: "Select an industry",
Options: []combobox.Option{
{Value: "tech", Label: "Technology"},
{Value: "health", Label: "Healthcare"},
{Value: "finance", Label: "Finance"},
},
})
// Multi-Select with Checkboxes
@combobox.Combobox(combobox.Config{
ID: "skills",
Label: "Skills",
Mode: combobox.ModeMultiple,
EnableClearAll: true,
Options: []combobox.Option{
{Value: "go", Label: "Go"},
{Value: "js", Label: "JavaScript"},
{Value: "py", Label: "Python"},
},
})
// With Search
@combobox.Combobox(combobox.Config{
ID: "country",
Label: "Country",
EnableSearch: true,
Options: countries,
})
// With Images (Avatars)
@combobox.Combobox(combobox.Config{
ID: "user",
Label: "Share with",
Options: users, // Options with Img field
})
// HTMX Lazy Loading
@combobox.Combobox(combobox.Config{
ID: "products",
Label: "Product",
HXMTEndpoint: "/api/products",
EnableSearch: true,
HTMXSearchParam: "q",
})