DropDown widget
The DropDown Widget enables the rendering of dropdown menus, providing users with a selectable list of options within your application for intuitive and efficient data selection.
Test in Kitchen Sink (opens in a new tab)
Properties
Property | Type | Description |
---|---|---|
id | string | ID to be referenced later |
maxWidth | integer | The max width of this Input widget (default 700). while min vlaue can be 0 and maximum can be 5000 |
label | string | Label for your widget |
labelHint | string | Hint text on your label |
labelStyle | TextStyle | Styling for the label |
hintText | string | Hint text explaining your widget |
required | boolean | Whether the field is required |
enabled | boolean | Enables or disables the interactivity and input functionality of the widget |
icon | object | See properties |
onChange | action | Call Ensemble's built-in functions or execute code when the input changes. Note for free-form text input, this event only dispatches if the text changes AND the focus is lost (e.g. clicking on button) |
value | string | Specifying the value of your Text Input |
autoComplete | boolean | Enable the Input search suggestion option |
items | array | List of values, or Objects with value/label pairs |
itemTemplate | ItemTemplate | Use this to iterate through a data array and render each dropdown item, as well as specify the selected item's value |
ItemTemplate
Property | Type | Description |
---|---|---|
data | array | Specify an array of data (or an expression that resolves to an array). The system will iterate through each item in this array |
name | string | As the system iterate through the data, you can reference each item's data using this name |
template | Widget | The widget to be rendered for each dropdown item in the data array. The widget can reference the data using the name specified above. |
value | string | Specify the expression to evaluate as each item's value. This will be the value when a dropdown item is selected. |
Styles
Property | Type | Description |
---|---|---|
variant | string | Select a pre-defined look and feel for this Input widget. This property can be defined in the theme to apply to all Input widgets. see properties |
visible | boolean | Toggle a widget visibility on/off. Note that an invisible widget will not occupy UI space, unless the visibilityTransitionDuration is specified. |
visibilityTransitionDuration | number | Specify the duration in seconds when a widget animates between visible and not visible state. Note that setting this value will cause the widget to still occupy the UI space even when it is not visible. |
stackPositionTop | integer | The distance of the child's top edge from the top of the stack. This is applicable only for Stack's children. |
stackPositionBottom | integer | The distance that the child's bottom edge from the bottom of the stack. This is applicable only for Stack's children. |
stackPositionLeft | integer | The distance that the child's left edge from the left of the stack. This is applicable only for Stack's children. |
stackPositionRight | integer | The distance that the child's right edge from the right of the stack. This is applicable only for Stack's children. |
errorBorderColor | integer or string | The border color when there are errors on this input field. This property can be defined in the theme to apply to all Input widgets, starting with '0xFF' for full opacity. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange |
focusedBorderColor | integer or string | The border color when this input field is receiving focus. This property can be defined in the theme to apply to all Input widgets, starting with '0xFF' for full opacity. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange |
focusedErrorBorderColor | integer or string | The border color of this input field when it is receiving focus in its error state. This property can be defined in the theme to apply to all Input widgets, starting with '0xFF' for full opacity. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange |
disabledBorderColor | integer or string | The border color when this input field is disabled. This property can be defined in the theme to apply to all Input widgets, starting with '0xFF' for full opacity. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange |
fillColor | integer or string | The fill color for this input fields. This property can be defined in the theme to apply to all Input widgets, starting with '0xFF' for full opacity. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange |
elevation | integer | The z-coordinate at which to place this material relative to its parent. A non-zero value will show a shadow, with its size relative to the elevation value. Minimum value: 0, Maximum value: 24 |
elevationShadowColor | integer or string | The shadow color for the elevation, which can be represented in different formats. It can be specified as a number, a predefined color name, or a hexadecimal value starting with '0x'. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange |
elevationBorderRadius | string or integer | The border radius of the widget.This can be specified using CSS-like notation with 1 to 4 integers. Minimum value: 0. |
expanded | boolean | If the parent is a Row or Column, this flag will stretch this widget in the appropriate direction. (e.g stretch horizontally for parent of type Row) |
contentPadding | integer or string | Padding around your input content with CSS-style notation e.g. margin: 5 20 5 |
captureWebPointer | boolean | Applicable for Web only. When overlaying widgets on top of certain HTML container (e.g. Maps), the mouse click is captured by the HTML container, causing issue interacting with the widget. Use this to capture and maintain the mouse pointer on your widget. |
alignment | string | The alignment of the widget relative to its parent. topLeft , topCenter , topRight , centerLeft , center , centerRight , bottomLeft , bottomCenter , bottomRight |
borderRadius | string or integer | The border radius of the widget.This can be specified using CSS-like notation with 1 to 4 integers. Minimum value: 0. |
borderColor | integer or string | Sets the border color, starting with '0xFF' for full opacity. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange |
borderWidth | integer | Thickness of the border. Minimum value should be 0. |
expanded | boolean | If the parent is a Row or Column, this flag will stretch this widget in the appropriate direction. (e.g stretch horizontally for parent of type Row) |
textStyle | TextStyle | Styling for the selected text |
dropdownBackgroundColor | integer or string | Sets the background color of the panel with the list of options that appears when the dropdown is open, starting with '0xFF' for full opacity. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange |
dropdownOffsetX | integer | X-axis offset from the dropdown field of the panel with the list of options that appears when the dropdown or autocomplete is open |
dropdownOffsetY | integer | Y-axis offset from the dropdown field of the panel with the list of options that appears when the dropdown or autocomplete is open |
dropdownBorderRadius | integer | Border radius of the panel with the list of options that appears when the dropdown or autocomplete is open |
dropdownBorderColor | integer or string | Border color of the panel with the list of options that appears when the dropdown or autocomplete is open |
dropdownBorderWidth | integer | Border width of the panel with the list of options that appears when the dropdown or autocomplete is open |
dropdownMaxHeight | integer | Maximum height of the panel with the list of options that appears when the dropdown or autocomplete is open |
icon
Property | Type | Description |
---|---|---|
name | string | The name of the icon |
library | string | Which icon library to use. |
color | integer or string | The color specification for the text, which can be represented in different formats. It can be specified as a number, a predefined color name, or a hexadecimal value starting with '0x'. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange |
size | integer | Defines the dimensions or magnitude of an element, allowing control over its overall size within the layout. |