Skip to content

Inputs

Dropdown

Bit.BlazorUISelectMultiSelectComboBox

BitDropdown (also known as Select, MultiSelect or ComboBox) lets users pick one or more options from a list that opens on demand. The callout is a real listbox that keeps its grouping, is searchable with typeahead, stays fully navigable with the keyboard and is announced to a screen reader, and it covers large datasets through virtualization and on-demand loading. The ComboBox mode adds free typing, chips, autocomplete and token separators, every part of the component is templatable, and in a form it offers EditForm validation alongside a hidden native select that carries the value into a plain HTML form post. Three sizes, boxed, borderless and underlined variants, a swipeable panel on small screens and RTL support round it out.

Notes

The BitDropdown is a Multi-API component which can accept the list of Items in 3 different ways:
1. The BitDropdownItem class
2. A Custom Generic class
3. The BitDropdownOption component

Introduction

Music: Music Cocktails, Musician: AlexGuz, URL: https://open.spotify.com/artist/1u0Nlnljg2xGHJV6X7W4i1

Usage

Every example is live. Open its code to see exactly what produced the component running underneath.

Basic

BitDropdown in its simplest forms: single and multi select dropdowns, a required one (which marks its label and reports itself as required to assistive technologies), one preserving its original callout width instead of matching the width of the dropdown, and a custom delimiter for joining the selected values in multi select mode. A disabled dropdown cannot be focused or opened at all, while a read-only one stays focusable and its callout can still be browsed — only changing the selection is blocked, and every control that would change it (the clear button, the chip remove buttons) is hidden accordingly. The Title parameter adds the tooltip shown while the pointer rests on the dropdown. Clicking the Label moves the focus to the dropdown, and the Name parameter names the hidden native select that mirrors the selection, so the value also travels in a plain HTML form post.
















Grouping

The ItemType of an item decides what it is in the list: a Normal item is a selectable option, a Header item names the items that follow it, and a Divider item draws a line between them without ending the group. Headers and dividers are not options, so they are skipped by the keyboard navigation and the typeahead, they are never matched by a search, and the select all item ignores them. The grouping is not only visual: every option points at the header that names it, so a screen reader reads "Broccoli, option, 7 of 18, Vegetables" instead of leaving the user to infer the group from a heading they cannot see. Headers without an Id of their own are given a generated one for that purpose. The StickyHeaders parameter pins the header of a group to the top of the list while its items are scrolled past, so a long grouped list never leaves the user looking at items whose group has scrolled away.

The grouping survives a search: the headers of the groups that still have a match stay above them, and only the ones left naming nothing — along with a divider that lost the items on one of its sides — go with the items they framed. A result that arrived as a flat list would take the grouping away exactly when the list is hardest to read, so the third example below keeps it while filtering.





Prefix & Suffix

The Prefix and Suffix parameters put fixed text before and after the selected value — a unit, a currency, a category — and PrefixTemplate and SuffixTemplate replace them with any content, an icon for instance. They are decoration only: they are not part of the value and are not read out with it, so keep a descriptive Label for screen reader users.









FitWidth

The FitWidth parameter makes the dropdown only as wide as its content instead of stretching to the full width of its container, which suits toolbars and inline filters where a full-width control would look out of place. The callout still matches the width of the dropdown unless PreserveCalloutWidth is set.




Variants

Three parameters change how much furniture the dropdown draws around itself. NoBorder removes its border entirely, Underlined replaces the box with a single bottom border — the variant that suits a dense form where a box per field would be too much — and Transparent removes the background, so the control can sit on a colored or image surface without cutting a rectangle out of it. They are independent and combine freely; the callout keeps its own surface either way, so the items stay readable. Since the two borderless variants have no box to draw a focus ring around, the keyboard focus (and the invalid state) is shown as an underline instead, which keeps the cue visible without inventing a border that the variant exists to remove.










Responsive

When the Responsive parameter is true, the callout turns into a side panel on small screens instead of a floating list, making long item lists easier to use on mobile devices. The panel carries the label of the dropdown and a close button, and it can also be dismissed by swiping it away. Resize the window below the small breakpoint to see it.

Drop direction

The DropDirection parameter determines which directions the callout is allowed to open in. All picks whichever side fits best in the viewport, while TopAndBottom (the default) restricts it to opening above or below the dropdown. In both cases the callout flips to the opposite side when there is not enough room, and its item list is capped to the space that is actually available, so it never runs past the edge of the screen. Scroll the page so that these dropdowns sit near the top or the bottom of the viewport to see it.

MaxHeight caps the scrollable item list at a height of your own, in pixels, so a long list stays a modest panel instead of stretching to whatever the viewport allows. It is applied on top of that available space rather than in place of it, so it can only ever make the list shorter — a dropdown near the bottom of the window is still limited by the room it actually has. Note that this is the one size a stylesheet cannot reach: the height is measured and written as an inline style every time the callout opens, so a CSS rule would always lose to it.





Clear button

The ShowClearButton parameter adds a button that clears the current selection whenever the dropdown has a value, in both single and multi select modes. Clearing raises the usual value change events, plus the dedicated OnClear callback. In the ComboBox mode it also empties the input, so no filter is left behind by a button that says it clears what the dropdown is showing. The button is hidden while the dropdown is read-only or disabled, so it never offers an action that would be ignored.

ClearOnEscape gives the same clear to the keyboard, so taking back a selection does not require finding a button with the mouse. Escape stays a dismiss key first: it closes the callout, and in the ComboBox mode it drops the text that was typed into it, and only a press with nothing left to dismiss reaches the selection. It goes through the very same clear as the button, so it raises OnClear and is refused wherever the button would be — and it needs no ShowClearButton, so a dropdown that shows no clear button can still be cleared this way.


Value: f-app




Values: f-app,f-ban




OnClear:


OnClear count: 0




ClearOnEscape:


Value: f-app

SearchBox

The ShowSearchBox parameter adds a search input at the top of the callout to filter the items, and SearchBoxPlaceholder sets its placeholder. By default an item matches when its text contains the typed term, ignoring case; SearchFunction replaces that algorithm with any predicate of your own (the examples below switch it to a starts-with and an ends-with match). AutoFocusSearchBox puts the caret in the search input as soon as the callout opens - with the pointer and with Enter or Space on the keyboard alike - so typing filters right away. A clear button appears in the search input as soon as there is something to clear, which follows the text being typed rather than the term that has been applied: a search waiting to be committed (or held back by a debounce) can be taken back the moment it is typed. The search term is discarded whenever the callout closes, so the next opening always starts from the full list.








Custom search function:



Search options

A handful of parameters tune the default search without replacing it. SearchMode picks how the text of an item is matched against the typed term — Contains (the default), StartsWith, EndsWith or ExactMatch, always ignoring case. MinSearchLength holds the filtering back until the term reaches the given number of characters, which keeps a one-letter term from being treated as a real query (and, with an ItemsProvider, from turning every first keystroke into a request). While the term is still too short the callout shows a hint above the items saying how many characters are missing, so the untouched list under it reads as the full list instead of as a search that matched everything; MinSearchLengthText is the composite format of that hint, which receives the number of characters that are still needed and is announced to screen readers along with it. SearchIgnoreDiacritics matches the term against the item texts with the diacritics of both folded away, so Jose finds José and Muller finds Müller — which is what makes the search usable to anyone typing on a keyboard that has no accented keys. HighlightSearch emphasizes the matched part of each item text so the reason an item is in the result is visible at a glance, and it keeps lining up with the accented text because the folding replaces each character with exactly one character. Whenever a search is active the number of results is also announced to screen readers, with a message you can localize through the SearchResultsText parameter; that count follows the list as it is actually rendered, so the items HideSelectedItems takes out of it are not offered as results nobody can reach. All of them configure the built-in algorithm only; a SearchFunction replaces it outright and does its own matching.









Immediate search

By default the search box raises its search when the input is committed (on the change event). Enabling Immediate makes it search as you type (on the input event) instead. Because that can mean a request per keystroke with a remote data source, the immediate search can be rate-limited: DebounceTime waits until the typing pauses for the given number of milliseconds and then searches once, while ThrottleTime lets at most one search through per interval while the typing continues. The OnSearch event reports every search term that gets through. The ComboBox input is a different story: it is a text field whose whole purpose is to filter the list as it is typed, so it always searches on every keystroke and Immediate only decides there whether the two rate limits apply to it.


Search value:


Search value:


Validation

BitDropdown is a regular form input: inside an EditForm it takes part in data annotations validation, turns red and reports itself as invalid to assistive technologies when its field has an error, and renders a ValidationMessage like any other input. This example requires a value in the single select dropdown and keeps the number of selected items of the multi select one within a range.



Customization

Nearly every part of the dropdown can be replaced with your own content. ItemTemplate and HeaderTemplate render the normal items and the group headers of the callout, TextTemplate renders the selected value shown on the closed dropdown and PlaceholderTemplate what is shown while nothing is selected, LabelTemplate replaces the label, CaretDownIconName and CaretDownTemplate the chevron, and CalloutHeaderTemplate and CalloutFooterTemplate add fixed content above and below the scrollable item list — the footer being the usual home of an "add a new item" action. The templates that render an item receive the item itself, so the extra state carried in its Data property is available to them.














Binding

Every piece of the dropdown's state can be bound or observed. The selection is two-way bound over Value in single select mode and Values in multi select mode, or left uncontrolled with DefaultValue and DefaultValues and observed through the OnChange and OnValuesChange events; OnSelectItem hands over the clicked item itself rather than its value — in multi select mode for every pick, including the one that unselects an already selected item, which OnDeselectItem reports on its own so that an addition and a removal can be told apart. Reselectable makes the select events fire even when the already selected item is picked again, which is otherwise treated as a no-op. The open state of the callout is two-way bound via IsOpen, so it can be opened and closed from code, and the OnOpen and OnClose events report every change to it — a natural place to start fetching the items on first open.

ValueComparer decides whether two values stand for the same selection, in place of the default equality of the value type. That is what a value which is not its own identity needs: a record or a class used as the value compares by reference by default, so a value arriving from a form, a query string or a fresh fetch would never match the item it names, however equal the two look. The example below uses a case-insensitive comparer, so the value F-APP selects the item whose value is f-app. The comparer governs every value comparison the component makes — which item a value selects, which chip a removal takes away, whether a typed term is already selected — so two values it calls equal are one and the same selection throughout. Finally, OnFocusIn and OnFocusOut follow the focus of the dropdown as a whole: they sit on the trigger and focusin/focusout bubble, so moving between the trigger and the ComboBox input inside it does not report a round trip through the outside.


Two-way binding:


Selected Value: f-app



Selected Values: f-app,f-ban




OnChange:


Changed Value:



Changed Values:




OnSelectItem:


Selected Value:



Selected Value:




OnDeselectItem:


Last picked item:
Last unselected item:




Reselectable:


OnSelectItem count: 0




IsOpen:







OnOpen & OnClose:


The callout is closed.




OnFocusIn & OnFocusOut:


The dropdown is blurred.




ValueComparer:


Value: F-APP

ComboBox

The Combo parameter turns the dropdown into a ComboBox: an editable input renders in place of the selected text and filters the items as you type, so the trigger doubles as the search box. Enter selects the item whose text matches what was typed, Backspace on an empty input removes the last selected item, the arrow keys — and typing itself, which reveals the list it filters — open the callout, Escape abandons the typed term, and a term that was typed but never turned into a selection is discarded when the callout closes, so the input goes back to showing the current selection.

Requiring the typed text to match an item exactly makes Enter a dead key for anyone who only typed the beginning of a name, so AutoSelectFirstMatch lets a partial term stand for the first item it matches: typing ban and pressing Enter then selects Banana. It takes precedence over the Dynamic mode below, so a term that names an item the list already has selects that item instead of creating a second one beside it.

Whichever item a commit would take — the one the typed text names exactly, or the first one it still matches under AutoSelectFirstMatch — is marked in the list as you type, so what Enter is about to select is visible before it is pressed rather than only afterwards. The same item is named to a screen reader through the aria-activedescendant of the input, so the cue is not a visual-only one. When nothing is marked, Enter either creates a new item (with Dynamic) or does nothing at all.

SelectTextOnFocus selects whatever is already in the input when it takes the focus, so coming back to a combo box that holds a term and typing replaces that term instead of appending to it — which is what a field the user returns to in order to look for something else needs. An empty input has nothing to select, and neither has a read-only one, where the selection would only be a highlight over text that cannot be changed.


Value:



Value:



Value:



Values:

Chips

When the Chips parameter is true, the selected items render as chips inside the dropdown instead of one joined text, each with its own remove button that is reachable with the keyboard and announced with the text of the item it removes. It works in both single and multi select modes and pairs naturally with the ComboBox mode.

ChipTemplate draws the content of a chip from the item it stands for, which is what turns a bare list of names into avatars, icons or colored categories. It replaces the text only: the remove button is still rendered after it, so a chip stays removable however it is drawn.


Value:



Values:


Selection display

A multi select dropdown that lists every selected item quickly runs out of room. MaxDisplayedItems caps how many of them the closed dropdown shows: with Chips the extra ones collapse into an overflow chip whose text comes from OverflowTextFormat ("+{0}" by default), and without chips the joined list is replaced by the summary of SelectedItemsTextFormat ("{0} items selected" by default) as soon as the limit is passed. Nothing is removed from the selection — only the way it is displayed changes.

AutoClearSearch covers the other half of a multi select session: the callout stays open after a pick, so by default the next item has to be found through the filter left over from the previous one. Enabling it clears the search text after every selection instead. HideSelectedItems goes one step further and drops the picked items out of the callout altogether, which makes sense when the chips already show what is selected and the list is only about what is left to choose. A group header whose items have all been picked goes with them, and so does a divider that lost the items on one of its sides, so the list never opens with a stray rule or ends on a group name with nothing under it.

Across all of them the selection is reported in the order it was made rather than in the order of the item list: the chips, the joined text and the overflow summary follow the order of Values, which grows as the user picks, so the Backspace of the ComboBox removes the chip that was added last.









Dynamic ComboBox

When the Dynamic parameter is true, a text typed into the ComboBox that matches no existing item can be added as a new one, which is what makes free-form values (tags, e-mail recipients, ad-hoc categories) possible. DynamicValueGenerator produces the value of the new item from its text and OnDynamicAdd notifies about the addition so the item can be persisted into the source collection — and only about an addition that stands, so a term refused by the selection limit or by a one-way binding is never reported as one. Before creating anything the component first looks for an existing match; FindItemFunction and ExistsSelectedItemFunction replace the default case-insensitive text comparison used for those two lookups, and AutoSelectFirstMatch gets its turn between them and the creation, so a partially typed term that names an existing item selects it instead of creating a near-duplicate. While the typed text names nothing the list offers to create an item out of it as its first row, so adding one is something to see and click rather than a shortcut to know about; the row is what the enter key would take, it is reached with the arrow keys like any other option, and it disappears the moment the text names something the list already holds.


Value:




Combining the Combo, Chips and Dynamic parameters, new items get added by pressing the enter key (or the add button of the responsive panel on mobile) and render as removable chips.



Value:



Values:




DynamicItemTextFormat is the wording of that offer, which receives the text the item would be created from, and DynamicItemTemplate replaces it with markup of your own when a plain sentence is not enough. Type a name no fruit or vegetable has and the list says so in its own words.


Values:

Keyboard navigation

The dropdown is fully operable with the keyboard, following the ARIA authoring practices for a combobox: Enter, Space and the arrow keys open the callout and put the focus on the selected item (or the first one), ArrowUp and ArrowDown move between the items, Home and End jump to the first and the last one — from the closed dropdown too, so reaching the end of a long list never takes an opening key followed by a second one — PageUp and PageDown jump several items at a time, Enter and Space select the focused item, Escape and Alt+ArrowUp close the callout and return the focus to the dropdown, and Tab closes it and moves on — from the trigger just as much as from inside the callout, so a popup revealed without the focus is never left behind when the focus leaves the dropdown. Alt+ArrowDown is the exception among the openers: it reveals the list without moving the focus into it, so the trigger keeps it and the plain arrows can walk the list afterwards. Opening the callout with a mouse click focuses the selected item as well, so the keyboard can take over at any point. In multi select mode Ctrl+A (or Cmd+A) selects every item the current search shows — or clears them when they are all selected already — while inside the search and ComboBox inputs the shortcut keeps its native select-the-text behavior. Typing printable characters runs a typeahead: the accumulated characters jump to the item starting with them, repeating one character cycles through the items starting with it, and the buffer resets after a short pause. The arrow keys wrap around by default, so ArrowDown on the last item comes back to the first one; NoWrapNavigation stops them at the ends instead, which suits a long list where the jump from one end to the other is more likely to read as the focus having been lost than as a move that was asked for — the typeahead keeps wrapping either way, since it looks for the item that matches rather than for the one that comes next. Disabled and hidden items are skipped throughout. In virtualize mode only the rendered items take part in the typeahead, since the ones that have not been rendered yet have no text to match against. The options themselves stay out of the tab order, as the options of a listbox should: they are reached with the arrow keys, and Tab leaves the whole dropdown rather than walking through the list. In ComboBox mode the keys that belong to the typed text — the printable characters, Backspace, Delete, ArrowLeft and ArrowRight — return the focus to the input and act on it there, so arrowing into the list never strands the user away from the term they are typing. However the callout is dismissed — a key, a click outside it, the close button of the responsive panel or a swipe — the focus comes back to the dropdown (to the ComboBox input when there is one) instead of being dropped at the top of the page along with the element that was holding it. ClearOnEscape gives Escape one more job once it has nothing left to dismiss: a press with the callout already closed (and, in the ComboBox mode, with nothing typed) clears the selection, which is what a keyboard user otherwise has to reach the clear button for. See the Clear button section.





Select all

When the ShowSelectAll parameter is true, a select all item renders above the item list of a multi select dropdown. It selects everything with one click and clears everything with the next, and its check box shows an indeterminate state while only some of the items are selected, so it doubles as a summary of the current selection. It only ever applies to what the user can actually see: disabled items are skipped, and while a search is active it selects the search result rather than the whole list, leaving selections made outside the result untouched. The SelectAllText parameter customizes its text. It is not available when the items come from an ItemsProvider, since the items that are not loaded yet cannot be selected. It also honors MaxSelectedItems: it stops at the limit, and once there is no room left it clears the selection instead of doing nothing. It also goes away when there is nothing left for it to select — an empty list, or a search that matched nothing — instead of topping the empty state with a control that cannot do anything. While the callout is open, the Ctrl+A (or Cmd+A) shortcut toggles the same select all behavior from the keyboard, even when the select all item itself is not shown.


Values:


Selection limit

The MaxSelectedItems parameter limits how many items can be selected in the multi select dropdown. Once the limit is reached the unselected items are disabled rather than silently refusing the click, so the boundary is visible before it is hit, and they become available again as soon as an item is unselected. The select all item honors the same limit and stops adding items once it is reached — and since it can then never reach "all selected", the next click on it clears the selection instead of leaving the user with a control that does nothing. The items turning unavailable is a change only a sighted user notices, so reaching the limit is also announced to screen readers, with a message you can localize through MaxSelectedItemsText — and the announcement goes quiet again as soon as unselecting an item makes room.


Values:

Empty state

When there is no item to show, the callout renders a message instead of an empty list. There are two distinct cases and each gets its own text: EmptyText and EmptyTemplate cover a list that has nothing in it ("No items found" by default), while NoResultsText and NoResultsTemplate cover a search that matched nothing ("No results found" by default) — telling the user that their term found nothing is a different message from telling them the list is empty. When the no-results pair is not set the empty pair is used for both cases.











Loading

The IsLoading parameter reports that the items are still on their way: a spinner replaces the caret down element and the callout shows a loading indicator in place of the item list, while the dropdown itself stays enabled so the user can still open it and see what is happening. The message is customized with the LoadingText parameter and the whole indicator with the LoadingTemplate parameter.

Loading...


Fetching the products...


Loading...




A real fetch: the items get loaded when the button is clicked.



Virtualization

The Virtualize parameter renders only the items that are currently visible instead of the whole list, which keeps the callout fast with thousands of items; ItemSize tells it how tall an item is and OverscanCount how many extra items to keep rendered around the visible window. It works over a local Items collection, or over an ItemsProvider that fetches one page at a time from a server (and receives the current search term, so filtering happens remotely too). ItemsProviderDebounceTime (100ms by default) collapses the burst of requests that fast scrolling and typing produce into a single one, so the provider is not asked once per rendered frame. Because a value can be selected before the page holding its item has ever been fetched, InitialSelectedItems supplies those items up front so the dropdown can show their text right away. The VirtualizePlaceholder template fills the rows that are still being fetched. Opening a virtualized dropdown still lands on what is currently selected, even when that item sits thousands of rows down and has never been rendered: the list is scrolled to where its index says it is and the selection is centred in the window, the way a native select behaves. That needs an index to scroll to, so it applies to a local Items collection; with an ItemsProvider the loaded window is all the component has. Each option still reports where it sits in the whole set — the provider says how many items there are and which window it is handing over — so a screen reader announces "Item 4210 of 10,000" in a list that has never been loaded in full.



With Items:







With ItemsProvider:







With ItemsProvider and InitialSelectedItems:


Localization

Every piece of text the dropdown produces on its own is a parameter, so nothing has to stay in English in a localized app. Placeholder, Label and SearchBoxPlaceholder cover what is always visible; SelectAllText, EmptyText, NoResultsText and LoadingText cover the states of the callout; and the composite formats SelectedItemsTextFormat, OverflowTextFormat, SearchResultsText and MaxSelectedItemsText cover the texts built from a count, each receiving that count as {0}. The strings only a screen reader ever reads are parameters too, so a localized dropdown does not fall back to English the moment it is used without sight: ChipsRemoveButtonAriaLabel (a composite format that receives the text of the item its chip stands for), ClearButtonAriaLabel, SearchBoxAriaLabel, SearchBoxClearButtonAriaLabel, ResponsiveCloseButtonAriaLabel and ComboBoxAddButtonAriaLabel.

Höchstens 3 Einträge ausgewählt

Values: f-app,f-ban,v-bro




Wird geladen...

Icons

Every icon the dropdown draws on its own comes from the built-in Fluent UI set and can be swapped by name: CaretDownIconName for the chevron, ClearButtonIconName for the clear button, ItemCheckIconName for the check mark of the multi select items and of the select all row, SearchBoxIconName and SearchBoxClearIconName for the two icons of the search box, ChipsRemoveIconName for the remove button of a chip, and ResponsiveCloseIconName and ComboBoxAddButtonIconName for the close and add buttons that only the responsive panel shows. Each of them has an ...Icon counterpart that takes a BitIconInfo and wins when both are set, which is how an icon from outside the Fluent set gets in — see the External Icons section below. None of them is ever read out on its own: the icons are hidden from assistive technologies and the button around them carries the accessible name, which is why those names are parameters of their own.











Close on select

Each mode dismisses the callout the way its interaction expects: a single select dropdown closes on the pick, because that pick is the whole interaction, while a multi select one stays open so the next item can be chosen without reopening the list. CloseOnSelect overrides that decision in both directions. Set it to false on a single select dropdown to keep the list open while the user tries one option after another against the page behind it, or to true on a multi select one to turn every pick into a complete interaction of its own — useful when each selection triggers work that the user should see before choosing again.

Whichever way it goes, the focus follows: a callout that closes hands the focus back to the dropdown (or to its ComboBox input), so the keyboard is never left stranded on an element that has just been removed from the page, while a callout that stays open keeps the focus on the option that was picked, ready for the next arrow key.


Value:



Values:

Token separators

The TokenSeparators parameter turns the listed characters into term endings for the multi select ComboBox input: typing one commits the term before it exactly as pressing Enter would, and pasting a whole delimited list commits every term it contains in one go. A term that names an existing item selects that item, and — with Dynamic enabled — a term that names none becomes a new item, so a list copied out of a spreadsheet or an e-mail turns into a selection without being retyped item by item. A term the selection already covers is refused, so committing the same list twice does not duplicate anything.


Values:

Open on focus

The OpenOnFocus parameter opens the callout the moment the dropdown receives the focus, so tabbing into it (or clicking any part of it) already shows the items without a further click or key press — one interaction fewer in a form that is filled top to bottom. The component tells a focus move made by the user apart from one made by its own focus management: a dismissal that returns the focus to the dropdown (Escape, a pick that closes the callout) does not reopen what was just closed.


Value:

Description

The Description parameter renders a line of helper text under the dropdown — the place for the rule that the label has no room for ("only the categories you have access to", "leave empty for all regions"). It is not decoration: the dropdown points at it with aria-describedby, so a screen reader reads it along with the control instead of leaving it as text that merely happens to sit underneath. In the ComboBox mode the editable input is described by it as well, since that is the element the user is actually typing into. DescriptionTemplate replaces it with any content — a link, an icon, a warning that changes with the selection — and is tied to the dropdown in exactly the same way.

Only the categories you have access to are listed.


Type a few letters to narrow the list down.


Nothing here is final — you can change it later.

Color

The Color parameter paints the accents of the dropdown — the focus border, the search box underline and icon, the group headers and the check boxes of the multi select items — in one of the theme colors, Primary being the default. It changes the accents only, not the surface of the control, so the dropdown keeps fitting its surroundings.















External Icons

Every icon of the dropdown can come from an external library instead of the built-in Fluent UI set. The CaretDownIcon, ClearButtonIcon, ChipsRemoveIcon, SearchBoxIcon, SearchBoxClearIcon, ResponsiveCloseIcon and ItemCheckIcon parameters take a BitIconInfo — built with BitIconInfo.Fa, BitIconInfo.Bi or the generic BitIconInfo.Css — and each takes precedence over its ...IconName counterpart when both are set. The items themselves follow the same rule through their Icon and IconName members. Remember to reference the stylesheet of the icon library you use.
















Size

The Size parameter scales the whole component in one step, Medium being the default: the height and the font size of the dropdown, of its search box and of the items in the callout all follow the chosen size.





Style & Class

The dropdown can be styled at every level: Style and Class apply to the root element, each item carries its own style and class, and the Styles and Classes parameters reach every internal part of the component individually — the label, the container, the callout, the search box, the scroll container, the items and everything else listed in the class-styles reference below. Because the callout is rendered outside the root element, styling it through Styles.Callout or Classes.Callout is the way to reach it rather than a descendant selector on the root.


Component's Style & Class:






Item's Style & Class:





Styles & Classes:


RTL

Setting the Dir parameter to Rtl renders the dropdown right-to-left for languages like Arabic, Persian and Hebrew: the text, the label, the chevron, the check boxes and the search box all mirror, the callout aligns to the right edge of the dropdown, and the responsive panel slides in from the left and is swiped away in the opposite direction. The callout is rendered outside the dropdown so that it can escape any clipping ancestor around it, which also puts it out of the reach of the direction the dropdown declares, so it carries that direction itself — the list of an RTL dropdown reads right-to-left even on a page that does not.





API

Every parameter, public member, sub-class and enum this component exposes.

BitDropdown parameters

Name Type Default value Description
AutoClearSearch bool false Clears the typed search text after each selection in the multi select ComboBox mode, so the next item is picked from the full list instead of from the previous filter.
AutoFocus bool false Gives the focus to the dropdown as soon as it is rendered.
AutoFocusSearchBox bool false Enables auto-focusing of the SearchBox input when the callout is open.
AutoSelectFirstMatch bool false Makes Enter in the ComboBox mode pick the first item the typed text matches when no item matches it exactly, which is what an autocomplete does: typing "app" and pressing Enter then selects "Apple" instead of doing nothing. It takes precedence over Dynamic, so a term that matches an existing item selects that item rather than creating a new one out of it.
CalloutFooterTemplate RenderFragment? null Custom template to render as a footer in the callout.
CalloutHeaderTemplate RenderFragment? null Custom template to render as a header in the callout.
CaretDownIcon BitIconInfo? null The icon of the chevron down element. Takes precedence over CaretDownIconName when both are set. Use for external icon libraries (e.g. BitIconInfo.Fa("solid chevron-down"), BitIconInfo.Bi("chevron-down"), BitIconInfo.Css("my-class")).
CaretDownIconName string? null The icon name of the chevron down element of the dropdown from the Fluent UI icon set.
CaretDownTemplate RenderFragment? null The custom template for the chevron down element of the dropdown.
ChildContent RenderFragment? null The content of the Dropdown, a list of BitDropdownOption components.
Chips bool false Shows the selected items like chips in the BitDropdown.
ChipsRemoveButtonAriaLabel string? null The composite format of the accessible name of the remove button of a chip, which receives the text of the item the chip stands for, for example "Remove {0}". Defaults to the English message.
ChipsRemoveIcon BitIconInfo? null The icon of the remove button in the chips display. Takes precedence over ChipsRemoveIconName when both are set.
ChipsRemoveIconName string? null The icon name of the remove button in the chips display from the Fluent UI icon set.
ChipTemplate RenderFragment<TItem>? null The custom template for the content of a chip in the chips display, which receives the item the chip stands for. It replaces the text of the chip only; the remove button is still rendered after it.
Classes BitDropdownClassStyles? null Custom CSS classes for different parts of the BitDropdown.
ClearButtonAriaLabel string? null The accessible name (and the tooltip) of the clear button of the dropdown. Defaults to the English message.
ClearButtonIcon BitIconInfo? null The icon of the clear button of the dropdown. Takes precedence over ClearButtonIconName when both are set.
ClearButtonIconName string? null The icon name of the clear button of the dropdown from the Fluent UI icon set.
ClearOnEscape bool false Makes the Escape key take back the whole selection once there is nothing left for it to dismiss: the first press closes the callout (and, in the ComboBox mode, drops the text that was typed into it), and only a press with the callout already closed and nothing typed clears what is selected. It reports itself through OnClear exactly as the clear button does, and it is refused in the same places that button is - a read-only dropdown, a one-way binding.
CloseOnSelect bool? null Determines whether picking an item in the callout closes it. It defaults to the behavior each mode expects: a single select dropdown closes, because the pick is the whole interaction, while a multi select one stays open so the next item can be picked right away. Set it explicitly to keep a single select callout open (a long list the user keeps trying options from) or to close a multi select one after every pick.
Color BitColor? null The general color of the dropdown.
Combo bool false Activates the ComboBox feature in BitDropDown component.
ComboBoxAddButtonAriaLabel string? null The accessible name (and the tooltip) of the add button in the responsive ComboBox mode. Defaults to the English message.
ComboBoxAddButtonIcon BitIconInfo? null The icon of the add button in the responsive ComboBox mode. Takes precedence over ComboBoxAddButtonIconName when both are set.
ComboBoxAddButtonIconName string? null The icon name of the add button in the responsive ComboBox mode from the Fluent UI icon set.
DefaultValues IEnumerable<TValue?>? null The default values that will be initially used to set selected items in multi select mode if the Values parameter is not set.
DebounceTime int 0 The debounce time in milliseconds for the search and combo box inputs (applied when Immediate is enabled).
Description string? null The description rendered below the dropdown, which is also tied to it as its accessible description through aria-describedby.
DescriptionTemplate RenderFragment? null The custom template for the description of the dropdown, which replaces Description and is tied to the dropdown in the same way.
DropDirection BitDropDirection BitDropDirection.TopAndBottom Determines the allowed drop directions of the callout.
Dynamic bool false It is allowed to add a new item in the ComboBox mode. While the typed text names no item the list offers to create one out of it.
DynamicItemTemplate RenderFragment<string>? null The custom template for the row the callout offers to create a new item with in the Dynamic ComboBox mode, which receives the text the item would be created from.
DynamicItemTextFormat string? null The composite format of the row the callout offers to create a new item with in the Dynamic ComboBox mode, which receives the text the item would be created from, for example "Add \"{0}\"".
DynamicValueGenerator Func<TItem?, TValue>? null The function for generating value in a custom item when a new item is on added Dynamic ComboBox mode.
EmptyTemplate RenderFragment? null The custom template to render in the callout when there is no item to show.
EmptyText string? null The text to render in the callout when there is no item to show.
ExistsSelectedItemFunction Func<ICollection<TItem>, string, bool>? null Decides whether the text committed in the ComboBox mode already stands for one of the selected items, in place of the default comparison of that text with the item texts, ignoring case. It receives the selected items and the committed text, and returning true stops the commit, so the same item cannot be selected (or created) twice under a name your data considers equivalent.
FindItemFunction Func<ICollection<TItem>, string, TItem?>? null Finds the item the text committed in the ComboBox mode stands for, in place of the default comparison of that text with the item texts, ignoring case. It receives the items and the committed text; the item it returns gets selected, and only when it returns none does AutoSelectFirstMatch and then Dynamic get their turn.
FitWidth bool false Enables fit-content value for the width of the root element.
HeaderTemplate RenderFragment<TItem>? null The custom template for rendering the header items of the dropdown.
HideSelectedItems bool false Removes the already selected items from the callout, which suits a multi select dropdown whose selection is visible as chips and whose list is therefore only about what is left to pick. A group header left naming nothing, and a divider left without items on one of its sides, are removed along with them. It has no effect when the items come from an ItemsProvider, which hands over the window it was asked for and is the only place that can leave the selected items out of it.
HighlightSearch bool false Highlights the part of the item text that matched the current search text in the callout. Only applies to the default item rendering, not to a custom ItemTemplate. The highlighted part is found by the built-in algorithm (SearchMode and SearchIgnoreDiacritics), so a custom SearchFunction that matches by some other rule can produce items with nothing to highlight.
InitialSelectedItems IEnumerable<TItem>? null The initial items that will be used to set selected items when using an ItemProvider.
Immediate bool false Searches the items as the user types in the search box (based on the 'oninput' HTML event) instead of waiting for the search box to be committed. The ComboBox input always searches as it is typed, so there it only decides whether DebounceTime and ThrottleTime apply.
IsLoading bool false Shows a loading indicator in the callout (and in place of the caret down element) while the items are being fetched. The dropdown stays interactive, so the user can still open the callout and see the loading state.
IsOpen bool false Determines the opening state of the callout. (two-way bound)
ItemCheckIcon BitIconInfo? null The icon of the check mark in the multi-select items. Takes precedence over ItemCheckIconName when both are set.
ItemCheckIconName string? null The icon name of the check mark in the multi-select items from the Fluent UI icon set.
Items ICollection<TItem>? null The list of items to display in the callout.
ItemSize int 35 The height of each item in pixels for virtualization.
ItemsProvider BitDropdownItemsProvider<TItem>? null The function providing items to the list for virtualization. It loads the items on demand, in the windows the user actually scrolls to, and receives the current search text so the filtering happens at the source instead of over an already loaded list. It requires Virtualize to be enabled, which is what requests the windows.
ItemsProviderDebounceTime int 100 The delay in milliseconds before an ItemsProvider request is issued, which collapses the bursts of requests produced by fast scrolling and typing into a single one.
ItemTemplate RenderFragment<TItem>? null The custom template for rendering the items of the dropdown.
Label string? null The text of the label element of the dropdown.
LabelTemplate RenderFragment? null The custom template for the label of the dropdown.
LoadingTemplate RenderFragment? null The custom template to render in the callout in place of the items while IsLoading is enabled.
LoadingText string? null The text to render in the callout in place of the items while IsLoading is enabled. Defaults to "Loading...".
MaxDisplayedItems int? null The maximum number of selected items rendered in the dropdown itself. Beyond it, the chips display collapses the extra ones into an overflow indicator and the text display switches to a summary. Zero or null renders every selected item.
MaxHeight int? null The maximum height of the scrollable item list of the callout in pixels. It is applied on top of the space the viewport leaves, so it can only ever make the list shorter. A value that is not greater than zero (and null) leaves the viewport alone to decide.
MaxSelectedItems int? null The maximum number of items that can be selected in multi select mode. A value that is not greater than zero (and null) means no limit.
MaxSelectedItemsText string? null The composite format of the message announced to screen readers once MaxSelectedItems is reached, which receives that limit, for example "Maximum of {0} items selected". Defaults to the English message.
MinSearchLength int 0 The number of characters the search text must reach before the items get filtered. While the search text is shorter, the full list is shown and no search is performed.
MinSearchLengthText string? null The composite format of the hint the callout shows while the typed text is still shorter than MinSearchLength, which receives the number of characters that are still missing, for example "Type {0} more characters to search". It is what tells the user that the list they are looking at is the full one rather than the result of what they typed, and it is announced to screen readers as well. Defaults to the English message; the hint is not shown at all while nothing has been typed, where the full list needs no explaining.
MultiSelect bool false Enables the multi select mode.
MultiSelectDelimiter string , The delimiter for joining the values to create the text of the dropdown in multi select mode.
Name string? null The name of the hidden native select element that mirrors the selection, so the value takes part in a plain HTML form post. It is intended for use with forms and is not displayed in the UI.
NameSelectors BitDropdownNameSelectors<TItem, TValue>? null Names and selectors of the custom input type properties.
NoBorder bool false Removes the border from the root element.
NoResultsTemplate RenderFragment? null The custom template to render in the callout when the current search has no result. Falls back to the EmptyTemplate when not set.
NoResultsText string? null The text to render in the callout when the current search has no result. Falls back to the EmptyText when not set.
NoWrapNavigation bool false Stops the arrow keys at the ends of the item list instead of letting them wrap around from the last item to the first one and back, which suits a long list where the wrap is more likely to read as the focus having been lost than as a deliberate jump. The type-ahead still wraps, since it looks for the item that matches rather than for the one that comes next. It has no effect in virtualize mode, where the ends of the rendered window are not the ends of the list and the focus stops at them either way.
OnClear EventCallback The callback that is called when the selection gets cleared, either by the clear button or by the Escape key when ClearOnEscape is enabled.
OnClick EventCallback<MouseEventArgs> The click callback for the dropdown.
OnClose EventCallback The callback that is called when the callout gets closed.
OnDeselectItem EventCallback<TItem> The callback that is called when a selected item gets unselected in multi select mode, by picking it again in the callout, by removing its chip, or through the UnselectItem method. Clearing the whole selection reports itself through OnClear instead.
OnDynamicAdd EventCallback<TItem> The callback that is called when a new item is on added Dynamic ComboBox mode.
OnFocusIn EventCallback<FocusEventArgs> The callback that is called when the dropdown (or any element inside it, like the ComboBox input) receives the focus.
OnFocusOut EventCallback<FocusEventArgs> The callback that is called when the dropdown (or any element inside it, like the ComboBox input) loses the focus. The callout is rendered outside the dropdown so that it can escape any clipping ancestor, so moving the focus into it (with the arrow keys, or by clicking the search box) counts as leaving the dropdown here.
OnOpen EventCallback The callback that is called when the callout gets opened.
OnSearch EventCallback<string?> The callback that is called when the search text of the search box or combo box input changes, with the term the items are getting filtered by.
OnSelectItem EventCallback<TItem> The callback that is called when an item gets picked in the callout. In multi select mode it reports every pick, including the one that unselects an already selected item; use OnDeselectItem to be told only about those.
OnValuesChange EventCallback<IEnumerable<TValue?>> The callback that is called when the selected items change.
OpenOnFocus bool false Opens the callout as soon as the dropdown receives the focus, so tabbing into it (or clicking any part of it) already shows the items without a further click or key press.
Options RenderFragment? null Alias of ChildContent.
OverflowTextFormat string? null The composite format of the overflow indicator that stands for the selected items beyond MaxDisplayedItems in the chips display, for example "+{0}".
OverscanCount int 3 Determines how many additional items are rendered before and after the visible region.
Placeholder string? null The placeholder text of the dropdown.
PlaceholderTemplate RenderFragment<BitDropdown<TItem, TValue>>? null The custom template for the placeholder of the dropdown.
Prefix string? null Prefix displayed before the dropdown contents. This is not included in the value. Ensure a descriptive label is present to assist screen readers, as the value does not include the prefix.
PrefixTemplate RenderFragment? null Shows the custom prefix for dropdown.
PreserveCalloutWidth bool false Disables automatic setting of the callout width and preserves its original width.
Reselectable bool false Enables calling the select events when the same item is selected in single select mode.
Responsive bool false Enables the responsive mode of the component for small screens.
ResponsiveCloseButtonAriaLabel string? null The accessible name (and the tooltip) of the close button in the responsive mode callout. Defaults to the English message.
ResponsiveCloseIcon BitIconInfo? null The icon of the close button in the responsive mode callout. Takes precedence over ResponsiveCloseIconName when both are set.
ResponsiveCloseIconName string? null The icon name of the close button in the responsive mode callout from the Fluent UI icon set.
SearchBoxAriaLabel string? null The accessible name of the SearchBox input. Defaults to the English message.
SearchBoxClearButtonAriaLabel string? null The accessible name (and the tooltip) of the clear button of the SearchBox. Defaults to the English message.
SearchBoxClearIcon BitIconInfo? null The icon of the clear icon in the SearchBox. Takes precedence over SearchBoxClearIconName when both are set.
SearchBoxClearIconName string? null The icon name of the clear icon in the SearchBox from the Fluent UI icon set.
SearchBoxIcon BitIconInfo? null The icon of the search icon in the SearchBox. Takes precedence over SearchBoxIconName when both are set.
SearchBoxIconName string? null The icon name of the search icon in the SearchBox from the Fluent UI icon set.
SearchBoxPlaceholder string? null The placeholder text of the SearchBox input.
SearchFunction Func<ICollection<TItem>, string, ICollection<TItem>>? null Custom search function to be used in place of the default search algorithm. Takes precedence over SearchMode, which only configures the default algorithm.
SearchIgnoreDiacritics bool false Matches the search text against the item texts with the diacritics of both removed, so that "Jose" finds "José" and "Muller" finds "Müller". The item text itself is left untouched, and so is the part of it that HighlightSearch emphasizes. Ignored when a SearchFunction is provided, which does its own matching.
SearchMode BitDropdownSearchMode BitDropdownSearchMode.Contains Determines how the text of an item is matched against the search text by the default (case-insensitive) search algorithm. Ignored when a SearchFunction is provided.
SearchResultsText string? null The composite format of the message announced to screen readers with the number of items the current search produced, for example "{0} results available". Defaults to the English message.
SelectAllText string? null The text of the select all item in multi select mode.
SelectedItemsTextFormat string? null The composite format that replaces the joined item texts in the dropdown once more than MaxDisplayedItems items are selected, for example "{0} items selected".
SelectTextOnFocus bool false Selects the text already in the ComboBox input whenever it takes the focus, so that typing replaces the term that is there instead of appending to it - which is what a field the user comes back to in order to search for something else needs. It has no effect outside of the ComboBox mode, and none while the input is empty, where there is nothing to select.
ShowClearButton bool false Shows the clear button when an item is selected.
ShowSearchBox bool false Shows the SearchBox element in the callout.
ShowSelectAll bool false Shows the select all item in the callout in multi select mode. It has no effect when the items are provided by an ItemsProvider, since the items that are not loaded yet cannot be selected.
Size BitSize? null The size of the dropdown.
StickyHeaders bool false Keeps the header of a group pinned to the top of the item list while its items are scrolled past, so a long grouped list never leaves the user looking at items whose group has scrolled out of view.
Styles BitDropdownClassStyles? null Custom CSS styles for different parts of the BitDropdown.
Suffix string? null Suffix displayed after the dropdown contents. This is not included in the value. Ensure a descriptive label is present to assist screen readers, as the value does not include the suffix.
SuffixTemplate RenderFragment? null Shows the custom suffix for dropdown.
TextTemplate RenderFragment<BitDropdown<TItem, TValue>>? null The custom template for the text of the dropdown.
ThrottleTime int 0 The throttle time in milliseconds for the search and combo box inputs (applied when Immediate is enabled).
Title string? null The title to show when the mouse hovers over the dropdown.
TokenSeparators char[]? null The characters that split the text typed (or pasted) into the multi select ComboBox input into separate terms, each committed as its own selection exactly as typing it and pressing Enter would: a term naming an existing item selects it, and with Dynamic enabled a term naming none adds a new item.
Transparent bool false Removes the default background color from the root element.
Underlined bool false Renders the dropdown with only a bottom border in place of the box around it.
ValueComparer IEqualityComparer<TValue>? null Decides whether two values stand for the same selection, in place of the default equality of TValue. It governs every value comparison the component makes: which item a value selects, which selected item a chip removes, and whether a typed term is already selected.
Values IEnumerable<TValue?>? null The values of the selected items in multi select mode. (two-way bound)
Virtualize bool false Enables virtualization to render only the visible items.
VirtualizePlaceholder RenderFragment<PlaceholderContext>? null The template for items that have not yet been rendered in virtualization mode.

BitDropdown public members

Name Type Default value Description
SelectedItems IReadOnlyList<TItem> A readonly list of the current selected items in multi-select mode.
SelectedItem TItem? The current selected item in single-select mode.
SelectItem Task SelectItem(TItem? item) Selects the given item exactly as picking it in the callout would, so the same events fire and the same close and focus behavior follows. An item that is already selected is left alone: in multi select mode picking it again would unselect it, which UnselectItem is for.
UnselectItem Task UnselectItem(TItem? item) Unselects the given item exactly as picking an already selected one in the callout would (or, in single select mode, as the clear button would), so the same events fire. An item that is not selected is left alone.
RefreshItemsAsync Task RefreshItemsAsync() Discards the items loaded so far and asks the ItemsProvider for them again, which is what makes a change outside of the dropdown (a filter of the page, a record added elsewhere) reach a list the dropdown only ever loads on demand. It does nothing without an ItemsProvider, where the Items collection is the source of truth and is re-read on its own.
AssignIsOpen Task<bool> AssignIsOpen(bool value) Opens or closes the callout programmatically, without having to bind the IsOpen parameter. It returns false when the change was refused, which is what a one-way bound IsOpen does.
InputElement ElementReference The ElementReference to the combobox element of the dropdown, which is the element the user focuses and operates the component with.
FocusAsync ValueTask FocusAsync(bool preventScroll = false) Gives focus to the combobox element of the dropdown.
ComboInputElement ElementReference? The ElementReference to the combo input element.
FocusComboInputAsync ValueTask FocusComboInputAsync() Gives focus to the combo input element.
SearchInputElement ElementReference? The ElementReference to the search input element.
FocusSearchInputAsync ValueTask FocusSearchInputAsync() Gives focus to the search input element.

BitInputBase parameters

Name Type Default value Description
DefaultValue TValue? null The default value of the input to be used in uncontrolled mode (i.e. when the Value is not bound), typically used alongside the OnChange callback.
DisplayName string? null Gets or sets the display name for this field.
InputHtmlAttributes IReadOnlyDictionary<string, object>? null Gets or sets a collection of additional attributes that will be applied to the created element.
Name string? null Gets or sets the name of the element. Allows access by name from the associated form.
NoValidate bool false Disables the validation of the input.
OnChange EventCallback<TValue?> Callback for when the input value changes.
ReadOnly bool false Makes the input read-only.
Required bool false Makes the input required.
Value TValue? null Gets or sets the value of the input. This should be used with two-way binding.

BitInputBase public members

Name Type Default value Description
InputElement ElementReference The ElementReference of the input element.
FocusAsync() () => ValueTask Gives focus to the input element.
FocusAsync(bool preventScroll) (bool preventScroll) => ValueTask Gives focus to the input element.

BitComponentBase parameters

Name Type Default value Description
AriaLabel string? null Gets or sets the accessible label for the component, used by assistive technologies.
Class string? null Gets or sets the CSS class name(s) to apply to the rendered element.
Dir BitDir? null Gets or sets the text directionality for the component's content.
ForceAnimation bool false Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested.
HtmlAttributes Dictionary<string, object> new Dictionary<string, object>() Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters.
Id string? null Gets or sets the unique identifier for the component's root element.
IsEnabled bool true Gets or sets a value indicating whether the component is enabled and can respond to user interaction.
Style string? null Gets or sets the CSS style string to apply to the rendered element.
TabIndex string? null Gets or sets the tab order index for the component when navigating with the keyboard.
Visibility BitVisibility BitVisibility.Visible Gets or sets the visibility state (visible, hidden, or collapsed) of the component.

BitComponentBase public members

Name Type Default value Description
UniqueId Guid Guid.NewGuid() Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed.
RootElement ElementReference Gets the reference to the root HTML element associated with this component.

BitDropdownNameSelectors<TItem, TValue> properties

Name Type Default value Description
AriaLabel BitNameSelectorPair<TItem, string?> new(nameof(BitDropdownItem<TValue>.AriaLabel)) The AriaLabel field name and selector of the custom input class.
Class BitNameSelectorPair<TItem, string?> new(nameof(BitDropdownItem<TValue>.Class)) The CSS Class field name and selector of the custom input class.
Id BitNameSelectorPair<TItem, string?> new(nameof(BitDropdownItem<TValue>.Id)) The Id field name and selector of the custom input class.
Data BitNameSelectorPair<TItem, object?> new(nameof(BitDropdownItem<TValue>.Data)) The Data field name and selector of the custom input class.
IsEnabled BitNameSelectorPair<TItem, bool> new(nameof(BitDropdownItem<TValue>.IsEnabled)) The IsEnabled field name and selector of the custom input class.
IsHidden BitNameSelectorPair<TItem, bool> new(nameof(BitDropdownItem<TValue>.IsHidden)) The IsHidden field name and selector of the custom input class.
ItemType BitNameSelectorPair<TItem, BitDropdownItemType> new(nameof(BitDropdownItem<TValue>.ItemType)) The ItemType field name and selector of the custom input class.
Icon BitNameSelectorPair<TItem, BitIconInfo?> new(nameof(BitDropdownItem<TValue>.Icon)) The Icon field name and selector of the custom input class.
IconName BitNameSelectorPair<TItem, string?> new(nameof(BitDropdownItem<TValue>.IconName)) The IconName field name and selector of the custom input class.
Style BitNameSelectorPair<TItem, string?> new(nameof(BitDropdownItem<TValue>.Style)) The CSS Style field name and selector of the custom input class.
Text BitNameSelectorPair<TItem, string?> new(nameof(BitDropdownItem<TValue>.Text)) The Text field name and selector of the custom input class.
Title BitNameSelectorPair<TItem, string?> new(nameof(BitDropdownItem<TValue>.Title)) The Title field name and selector of the custom input class.
Value BitNameSelectorPair<TItem, TValue?> new(nameof(BitDropdownItem<TValue>.Value)) The Value field name and selector of the custom input class.
TextSetter Action<string, TItem>? The setter function for updating Text property of custom item in Dynamic ComboBox mode upon new item addition.
ValueSetter Action<TItem, TItem>? The setter function for updating Value property of custom item in Dynamic ComboBox mode upon new item addition.
IsSelected string The IsSelected field name of the custom input class. This property's value is assigned by the component.

BitNameSelectorPair<TItem, TProp> properties

Name Type Default value Description
Name string Custom class property name.
Selector Func<TItem, TProp?>? Custom class property selector.

BitIconInfo properties

Name Type Default value Description
Name string? null Gets or sets the name of the icon.
BaseClass string? null Gets or sets the base CSS class for the icon. For built-in Fluent UI icons, this defaults to "bit-icon". For external icon libraries like FontAwesome, you might set this to "fa" or leave empty.
Prefix string? null Gets or sets the CSS class prefix used before the icon name. For built-in Fluent UI icons, this defaults to "bit-icon--". For external icon libraries, you might set this to "fa-" or leave empty.

BitDropdownClassStyles properties

Name Type Default value Description
Root string? null Custom CSS classes/styles for the root element of the BitDropdown.
Label string? null Custom CSS classes/styles for the label of the BitDropdown.
DescriptionContainer string? null Custom CSS classes/styles for the description container of the BitDropdown.
Description string? null Custom CSS classes/styles for the description of the BitDropdown.
Container string? null Custom CSS classes/styles for the main container of the BitDropdown.
TextContainer string? null Custom CSS classes/styles for the text container of the BitDropdown.
ClearButton string? null Custom CSS classes/styles for the clear button of the BitDropdown.
CaretDownIcon string? null Custom CSS classes/styles for the caret down icon of the BitDropdown.
Overlay string? null Custom CSS classes/styles for the overlay of the BitDropdown.
Callout string? null Custom CSS classes/styles for the callout of the BitDropdown.
CalloutHeader string? null Custom CSS classes/styles for the container of the callout header template of the BitDropdown.
CalloutFooter string? null Custom CSS classes/styles for the container of the callout footer template of the BitDropdown.
ResponsiveLabelContainer string? null Custom CSS classes/styles for the responsive panel's label container of the BitDropdown.
ResponsiveLabel string? null Custom CSS classes/styles for the responsive panel label of the BitDropdown.
ResponsiveCloseButton string? null Custom CSS classes/styles for the responsive panel's close button of the BitDropdown.
ResponsiveCloseIcon string? null Custom CSS classes/styles for the responsive panel's close icon of the BitDropdown.
SearchBoxContainer string? null Custom CSS classes/styles for the search box container of the BitDropdown.
SearchBoxIconContainer string? null Custom CSS classes/styles for the search box's icon container of the BitDropdown.
SearchBoxIcon string? null Custom CSS classes/styles for the search box icon of the BitDropdown.
SearchBoxInput string? null Custom CSS classes/styles for the search box input of the BitDropdown.
ComboBoxInput string? null Custom CSS classes/styles for the ComboBox input of the BitDropdown.
Chips string? null Custom CSS classes/styles for the chips container of the BitDropdown.
OverflowChip string? null Custom CSS classes/styles for the overflow chip of the BitDropdown.
ChipsRemoveButton string? null Custom CSS classes/styles for the chips's remove button of the BitDropdown.
ChipsRemoveIcon string? null Custom CSS classes/styles for the chips's remove icon of the BitDropdown.
SearchBoxClearButtonContainer string? null Custom CSS classes/styles for the search box's clear button container of the BitDropdown.
SearchBoxClearButton string? null Custom CSS classes/styles for the search box's clear button of the BitDropdown.
SearchBoxClearIcon string? null Custom CSS classes/styles for the search box's clear icon of the BitDropdown.
SearchHint string? null Custom CSS classes/styles for the hint the callout shows while the typed text is still shorter than the MinSearchLength of the BitDropdown.
SelectAllContainer string? null Custom CSS classes/styles for the select all item container of the multi-select BitDropdown.
SelectAllButton string? null Custom CSS classes/styles for the select all item button of the multi-select BitDropdown.
SelectAllCheckBox string? null Custom CSS classes/styles for the select all item check box of the multi-select BitDropdown.
SelectAllCheckIcon string? null Custom CSS classes/styles for the select all item check icon of the multi-select BitDropdown.
SelectAllText string? null Custom CSS classes/styles for the select all item text of the multi-select BitDropdown.
ScrollContainer string? null Custom CSS classes/styles for the scroll container of the BitDropdown.
ItemHeader string? null Custom CSS classes/styles for the item header of the BitDropdown.
ItemWrapper string? null Custom CSS classes/styles for the item wrapper of the multi-select BitDropdown.
ItemButton string? null Custom CSS classes/styles for the item button of the BitDropdown.
ItemCheckBox string? null Custom CSS classes/styles for the item check box of the multi-select BitDropdown.
ItemCheckIcon string? null Custom CSS classes/styles for the item check icon of the multi-select BitDropdown.
ItemIcon string? null Custom CSS classes/styles for the item icon of the BitDropdown.
ItemText string? null Custom CSS classes/styles for the item text of the BitDropdown.
ItemHighlight string? null Custom CSS classes/styles for the highlighted part of the item text of the BitDropdown.
ItemDivider string? null Custom CSS classes/styles for the item divider of the BitDropdown.
DynamicItem string? null Custom CSS classes/styles for the row that offers to create a new item out of the typed text in the Dynamic ComboBox mode of the BitDropdown.
EmptyContent string? null Custom CSS classes/styles for the empty state content of the BitDropdown.
LoadingContainer string? null Custom CSS classes/styles for the loading state container of the BitDropdown.
LoadingText string? null Custom CSS classes/styles for the loading state text of the BitDropdown.
Spinner string? null Custom CSS classes/styles for the loading spinner of the BitDropdown.
PrefixContainer string? null Custom CSS classes/styles for the dropdown's prefix container.
Prefix string? null Custom CSS classes/styles for the dropdown's prefix.
SuffixContainer string? null Custom CSS classes/styles for the dropdown's suffix container.
Suffix string? null Custom CSS classes/styles for the dropdown's suffix.
ResponsiveComboInputContainer string? null Custom CSS classes/styles for the ComboBox input container in responsive mode of the BitDropdown.
ResponsiveComboAddButton string? null Custom CSS classes/styles for the add new item combo box button in responsive mode of the BitDropdown.

BitDropdownItemType enum

Name Value Description
Normal 0 Dropdown items are being rendered as a normal item.
Header 1 Dropdown items are being rendered as a header, they cannot be selected.
Divider 2 Dropdown items are being rendered as a divider, just draw a line.

BitDropdownSearchMode enum

Name Value Description
Contains 0 An item matches when its text contains the search text.
StartsWith 1 An item matches when its text starts with the search text.
EndsWith 2 An item matches when its text ends with the search text.
ExactMatch 3 An item matches when its text is equal to the search text.

BitSize enum

Name Value Description
Small 0 The small size.
Medium 1 The medium size.
Large 2 The large size.

BitColor enum

Name Value Description
Primary 0 Primary general color.
Secondary 1 Secondary general color.
Tertiary 2 Tertiary general color.
Info 3 Info general color.
Success 4 Success general color.
Warning 5 Warning general color.
SevereWarning 6 SevereWarning general color.
Error 7 Error general color.
PrimaryBackground 8 Primary background color.
SecondaryBackground 9 Secondary background color.
TertiaryBackground 10 Tertiary background color.
PrimaryForeground 11 Primary foreground color.
SecondaryForeground 12 Secondary foreground color.
TertiaryForeground 13 Tertiary foreground color.
PrimaryBorder 14 Primary border color.
SecondaryBorder 15 Secondary border color.
TertiaryBorder 16 Tertiary border color.

BitVisibility enum

Name Value Description
Visible 0 The content of the component is visible.
Hidden 1 The content of the component is hidden, but the space it takes on the page remains (visibility:hidden).
Collapsed 2 The component is hidden (display:none).

BitDir enum

Name Value Description
Ltr 0 Ltr (left to right) is to be used for languages that are written from the left to the right (like English).
Rtl 1 Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic).
Auto 2 Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element.

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.