Our Blazor DropDown component allows you to display a drop-down window in your application. The window consists of the header, body, and footer elements. The header and footer are initially hidden. Set the HeaderVisible and FooterVisible properties to true to display these elements.
To show or close the DropDown in code, implement two-way binding for the IsOpen property. Users can click outside the DropDown's boundaries, or press Escape to close the component from the UI.
The DropDown component uses predefined appearance settings if you specify the HeaderText, BodyText, or FooterText property. To customize the window's content and appearance, you can use the following templates:
- HeaderTextTemplate, BodyTextTemplate, FooterTextTemplate - Allow you to customize a DropDown element text area. These templates replace the text content area only, so the predefined alignment and paddings apply.
- HeaderTemplate, BodyTemplate, FooterTemplate - Allow you to customize the entire area of DropDown elements. These templates replace all elements within the content, so the predefined appearance settings, content alignment, and paddings have no effect.
The DropDown recalculates its position when certain page elements are changed (for instance, when the page is scrolled or resized). Use the RestrictionMode property to restrict the DropDown position.
The FitToRestriction property specifies whether the DropDown can overlap restriction boundaries. When the component does not meet the position restrictions, it can be hidden or closed, based on the CloseMode property value.
Enable the AllowResize property to allow users to change the DropDown's size. When enabled, the component displays a size grip. Users can drag it to change the drop-down window width and height.