For more examples, visit the Storybook.

Example
<StudsComboBox
    Data="@customers"
    TextProperty="CompanyName"
    Placeholder="Select a company"
    Style="min-width: 12rem;" />

StudsComboBox Parameters

Data
IEnumerable<T>

Gets or sets the data to be displayed in the dropdown.

TextProperty
string
default:"CompanyName"

Gets or sets the name of the property to display in the dropdown.

Value
object

Gets or sets the selected value.

ValueChanged
EventCallback<string>

Gets or sets the callback that is invoked when the value changes.

Name
string

Gets or sets the name of the component.

Placeholder
string
default:"Select a company"

Gets or sets the placeholder text displayed when no item is selected.

Disabled
bool
default:"false"

Gets or sets a value indicating whether this component is disabled.

InputAttributes
IReadOnlyDictionary<string, object>

Specifies additional custom attributes that will be rendered by the input.

OpenOnFocus
bool
default:"false"

Gets or sets a value indicating whether popup should open on focus.

PopupStyle
string

Gets or sets the Popup height.

Template
RenderFragment<dynamic>

Gets or sets the template for rendering items in the dropdown.

MinLength
int
default:"1"

Gets or sets the minimum length of text required before filtering.

FilterDelay
int
default:"500"

Gets or sets the delay in milliseconds for debouncing filter operations.

FilterPlaceholder
string
default:"Search..."

Gets or sets the placeholder text for the filter input.

InputType
string
default:"text"

Gets or sets the underlying input type.

MaxLength
long?

Gets or sets the maximum length of text allowed in the input.

TabIndex
int
default:"0"

Gets or sets the index of the tab.

FilterCaseSensitivity
FilterCaseSensitivity
default:"CaseInsensitive"

Gets or sets whether filtering should be case-sensitive. Options: Default, CaseInsensitive

FilterOperator
StringFilterOperator
default:"Contains"

Gets or sets the filter operator used for filtering items. Options: Contains, StartsWith, EndsWith

Change
EventCallback<object>

Gets or sets the callback that is invoked when the selection changes.

LoadData
EventCallback<LoadDataArgs>

Gets or sets the callback for loading data dynamically.

SelectedItem
object

Gets the selected item, either the TextProperty value or the raw Value if TextProperty is not set.

SearchText
string

Gets or sets the search text used for filtering.

SearchTextChanged
EventCallback<string>

Gets or sets the callback that is invoked when the search text changes.

ValueExpression
Expression<Func<T>>

Gets or sets the value expression used for model binding.

Attributes
Dictionary<string, object>

Specifies additional custom attributes that will be rendered by the component.

MouseEnter
EventCallback<ElementReference>

Gets or sets the callback that is invoked when the mouse enters an item.

MouseLeave
EventCallback<ElementReference>

Gets or sets the callback that is invoked when the mouse leaves an item.

ContextMenu
EventCallback<MouseEventArgs>

A callback that will be invoked when the user right-clicks the component. Commonly used to display a context menu.

Culture
CultureInfo
default:"CultureInfo.CurrentCulture"

Gets or sets the culture used to display localizable data (numbers, dates). Set by default to “CultureInfo.CurrentCulture”.

Style
string

Gets or sets the inline CSS style.

Visible
bool
default:"true"

Gets or sets a value indicating whether this “T:Studs.StudsComponent” is visible. Invisible components are not rendered.