TextBox
TextBox is an input field with auto-suggest options.
Selector
smart-text-box
Properties
null
. This feature is especially useful for ensuring that dropdowns are visible and functional in complex layouts where parent elements limit visibility due to CSS overflow properties.Events
Methods
Properties
animation"none" | "simple" | "advanced"
Controls the animation mode for the component. You can retrieve the current mode or assign a new one. Setting this property to 'none' will disable all animations.
Allowed Values
- "none" - animation is disabled
- "simple" - ripple animation is disabled
- "advanced" - all animations are enabled
Default value
"advanced"Example
Set the animation property.
<smart-text-box animation='none'></smart-text-box>
Set the animation property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.animation = 'simple';
Get the animation property.
const textbox = document.querySelector('smart-text-box');
let animation = textbox.animation;
autoFocusboolean
Specifies whether the text box should automatically receive keyboard focus when the page loads, allowing users to start typing immediately without clicking inside the box.
Default value
falseExample
Set the autoFocus property.
<smart-text-box auto-focus></smart-text-box>
Set the autoFocus property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.autoFocus = false;
Get the autoFocus property.
const textbox = document.querySelector('smart-text-box');
let autoFocus = textbox.autoFocus;
autoComplete"none" | "auto" | "inline" | "manual"
Specifies the autocomplete mode used to filter and display suggestions from the dataSource. The selected autocomplete mode determines how input text is matched against the available items, showing only those entries that meet the criteria—for example, items that start with, contain, or exactly match the user's input. This setting helps control the relevance and behavior of suggestion lists shown to the user while typing.
Allowed Values
- "none" - Auto complete is disabled.
- "auto" - When the input matches one or many items from the dataSource the drop down opens and displays the matched items. The first suggested item is automatically highlighted as selected and becomes the value of the textbox when the combobox loses focus unless the user chooses a different item or changes the character string in the textbox.
- "inline" - When the input matches one or many items from the dataSource the drop down opens and displays the matched items. The first suggested item is automatically highlighted as selected and becomes the value of the textbox when the combobox loses focus unless the user chooses a different item or changes the character string in the textbox. In addition to that a completion helper that appears next to the input cursor in the input. This helper shows the first possible match by completing the input text.
- "manual" - When the input matches one or many items from the dataSource the drop down opens and displays the matched items.
Default value
"manual"Example
Set the autoComplete property.
<smart-text-box auto-complete='auto'></smart-text-box>
Set the autoComplete property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.autoComplete = 'manual';
Get the autoComplete property.
const textbox = document.querySelector('smart-text-box');
let autoComplete = textbox.autoComplete;
autoCompleteDelaynumber
Specifies the duration (in milliseconds) to wait after the user stops typing before displaying the dropdown with autocomplete suggestions. This delay helps control how quickly the matching results appear, improving performance and user experience by preventing unnecessary searches while the user is still typing.
Default value
100Example
Set the autoCompleteDelay property.
<smart-text-box auto-complete-delay='1000'></smart-text-box>
Set the autoCompleteDelay property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.autoCompleteDelay = 1100;
Get the autoCompleteDelay property.
const textbox = document.querySelector('smart-text-box');
let autoCompleteDelay = textbox.autoCompleteDelay;
dataSourceany
Specifies the data source that populates the ComboBox options. The dataSource property accepts multiple types:
- 'Array of strings or numbers:' Each item will be displayed as both the label and value of a list item.
- 'Array of objects:' Each object should contain properties—such as label (displayed text) and value (item value)—that define the corresponding list item’s display and value.
- 'Callback function:' You can provide a function that returns an array of items in either of the above forms. This allows for dynamic or asynchronous data loading.
This flexible approach lets you easily integrate static lists, complex objects, or data fetched from external sources into the ComboBox.
Example
Set the dataSource property.
<smart-text-box data-source='["item 1", "item 2"]'></smart-text-box>
Set the dataSource property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.dataSource = ["new item 1", "new item 2"];
Get the dataSource property.
const textbox = document.querySelector('smart-text-box');
let dataSource = textbox.dataSource;
disabledboolean
Determines whether the element is active and interactive (enabled) or inactive and unresponsive to user interactions (disabled). When set to "disabled," the element cannot be focused, clicked, or edited by the user.
Default value
falseExample
Set the disabled property.
<smart-text-box disabled></smart-text-box>
Set the disabled property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.disabled = false;
Get the disabled property.
const textbox = document.querySelector('smart-text-box');
let disabled = textbox.disabled;
displayLoadingIndicatorboolean
Specifies whether a visual indicator (such as a loading spinner or progress bar) will be displayed while filtering data or loading items from a remote source. This helps inform users that a background operation is in progress.
Default value
falseExample
Set the displayLoadingIndicator property.
<smart-text-box display-loading-indicator></smart-text-box>
Set the displayLoadingIndicator property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.displayLoadingIndicator = false;
Get the displayLoadingIndicator property.
const textbox = document.querySelector('smart-text-box');
let displayLoadingIndicator = textbox.displayLoadingIndicator;
displayMemberstring
Sets or retrieves the displayMember property. The displayMember determines which property of each object in the data source collection (defined by the 'dataSource' property) will be used for display purposes in the user interface. By specifying the name of a property here, you control which value from each data source item is shown to users (e.g., displaying a "name" property from a list of user objects).
Default value
""""Example
Set the displayMember property.
<smart-text-box display-member='label'></smart-text-box>
Set the displayMember property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.displayMember = 'name';
Get the displayMember property.
const textbox = document.querySelector('smart-text-box');
let displayMember = textbox.displayMember;
displayMode"default" | "escaped"
Specifies the visual presentation of characters within the input field, such as whether the characters are visible as plain text, masked (e.g., as password dots), or formatted in a particular style. This attribute controls how users see the inputted content while typing or reviewing their entries.
Allowed Values
- "default" - Default behavior. Every character is as is.
- "escaped" - Replaces the special characters with their corresponding character codes. For example, line breaks are replace with '
'.
Default value
"default"Example
Set the displayMode property.
<smart-text-box display-mode='escaped'></smart-text-box>
Set the displayMode property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.displayMode = 'default';
Get the displayMode property.
const textbox = document.querySelector('smart-text-box');
let displayMode = textbox.displayMode;
dropDownAppendToany
Specifies the parent container to which the dropdown menu is appended in the DOM. By default, the dropdown is rendered within its original parent element. However, if an ancestor element has restricted overflow (e.g., 'overflow: hidden' or 'overflow: auto'), the dropdown may be clipped and not display correctly. To resolve this, you can set the dropDownAppendTo property to ''body'', the ID of a specific HTML element, or a direct reference to an HTML element. When set, the dropdown will be moved to the specified container in the DOM, ensuring it displays properly regardless of overflow constraints in its ancestors. To restore the dropdown to its original parent, reset this property to null
.
This feature is especially useful for ensuring that dropdowns are visible and functional in complex layouts where parent elements limit visibility due to CSS overflow properties.
Example
Set the dropDownAppendTo property.
<smart-text-box drop-down-append-to='body'></smart-text-box>
Set the dropDownAppendTo property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.dropDownAppendTo = null;
Get the dropDownAppendTo property.
const textbox = document.querySelector('smart-text-box');
let dropDownAppendTo = textbox.dropDownAppendTo;
dropDownHeightstring | number
Specifies the height of the dropdown menu. By default, this property is set to an empty string, which means the dropdown's height will be determined by a CSS variable. To customize the dropdown's height directly, you can assign a specific value (e.g., "200px" or "50%") to this property. Otherwise, leaving it empty enables the component to use the height defined by the associated CSS variable.
Default value
""Example
Set the dropDownHeight property.
<smart-text-box drop-down-height='auto'></smart-text-box>
Set the dropDownHeight property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.dropDownHeight = 500;
Get the dropDownHeight property.
const textbox = document.querySelector('smart-text-box');
let dropDownHeight = textbox.dropDownHeight;
dropDownMaxHeightstring | number
Defines the maximum height for the dropdown menu. If no value is set (default is an empty string), the dropdown’s maximum height will be determined by a corresponding CSS variable instead. This allows for dynamic styling via CSS, while still providing the option to specify a fixed maximum height directly through this property.
Default value
""Example
Set the dropDownMaxHeight property.
<smart-text-box drop-down-max-height='800'></smart-text-box>
Set the dropDownMaxHeight property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.dropDownMaxHeight = 1000;
Get the dropDownMaxHeight property.
const textbox = document.querySelector('smart-text-box');
let dropDownMaxHeight = textbox.dropDownMaxHeight;
dropDownMaxWidthstring | number
Specifies the maximum width of the dropdown menu. By default, this property is set to an empty string, meaning that the dropdown's max-width is determined by a corresponding CSS variable. If a specific value (such as '300px' or '100%') is provided, it will override the CSS variable and directly set the maximum width of the dropdown.
Default value
""Example
Set the dropDownMaxWidth property.
<smart-text-box drop-down-max-width='500'></smart-text-box>
Set the dropDownMaxWidth property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.dropDownMaxWidth = 800;
Get the dropDownMaxWidth property.
const textbox = document.querySelector('smart-text-box');
let dropDownMaxWidth = textbox.dropDownMaxWidth;
dropDownMinHeightstring | number
Defines the minimum height of the dropdown menu. By default, this property is set to an empty string (""), which means the minimum height is not explicitly specified in the component and will instead be determined by the value of a related CSS variable. If a specific value (such as "200px" or "2rem") is provided, it will override the CSS variable and set the minimum height of the dropdown directly.
Default value
""Example
Set the dropDownMinHeight property.
<smart-text-box drop-down-min-height='50'></smart-text-box>
Set the dropDownMinHeight property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.dropDownMinHeight = 150;
Get the dropDownMinHeight property.
const textbox = document.querySelector('smart-text-box');
let dropDownMinHeight = textbox.dropDownMinHeight;
dropDownMinWidthstring | number
Specifies the minimum width of the dropdown menu. By default, this property is set to an empty string, which means the dropdown's minimum width is determined by a corresponding CSS variable. If you provide a specific value (such as '200px' or '20rem'), it will override the CSS variable and set the dropdown's minimum width accordingly.
Default value
""Example
Set the dropDownMinWidth property.
<smart-text-box drop-down-min-width='100'></smart-text-box>
Set the dropDownMinWidth property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.dropDownMinWidth = 90;
Get the dropDownMinWidth property.
const textbox = document.querySelector('smart-text-box');
let dropDownMinWidth = textbox.dropDownMinWidth;
dropDownOpenMode"none" | "default" | "auto"
Specifies the direction or animation style in which the dropdown menu appears when activated (e.g., opens upwards, downwards, or with a fade effect).
Allowed Values
- "none" - The drop down can't be opened.
- "default" - The drop down opens when the user clicks on the element
- "auto" - The drop down opens when the element is hovered and closes when not.
Default value
"default"Example
Set the dropDownOpenMode property.
<smart-text-box drop-down-open-mode='auto'></smart-text-box>
Set the dropDownOpenMode property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.dropDownOpenMode = 'default';
Get the dropDownOpenMode property.
const textbox = document.querySelector('smart-text-box');
let dropDownOpenMode = textbox.dropDownOpenMode;
dropDownOverlayboolean
When this property is enabled, opening the element’s dropdown will create a transparent overlay that covers the entire area between the dropdown and the rest of the webpage. This overlay ensures that any clicks outside the dropdown are intercepted by the overlay itself, rather than interacting with underlying DOM elements. As a result, clicking outside the dropdown can be handled consistently—for example, to close the dropdown—without triggering unintended interactions elsewhere on the page.
Default value
falseExample
Set the dropDownOverlay property.
<smart-text-box drop-down-overlay></smart-text-box>
Set the dropDownOverlay property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.dropDownOverlay = false;
Get the dropDownOverlay property.
const textbox = document.querySelector('smart-text-box');
let dropDownOverlay = textbox.dropDownOverlay;
dropDownPlaceholderstring
Specifies the placeholder text that appears in the dropdown menu when there are no available items to display. This text provides guidance or context to users, indicating that the dropdown is currently empty.
Default value
"No Items"Example
Set the dropDownPlaceholder property.
<smart-text-box drop-down-placeholder='No Items'></smart-text-box>
Set the dropDownPlaceholder property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.dropDownPlaceholder = 'Empty';
Get the dropDownPlaceholder property.
const textbox = document.querySelector('smart-text-box');
let dropDownPlaceholder = textbox.dropDownPlaceholder;
dropDownPosition"auto" | "top" | "bottom" | "overlay-top" | "overlay-center" | "overlay-bottom" | "center-bottom" | "center-top"
Specifies the alignment and placement of the dropdown menu relative to its trigger element when the dropdown is opened, allowing you to control where the menu appears on the screen (e.g., above, below, left, or right of the trigger).
Allowed Values
- "auto" - The position is automatically determines by measuring the available distance around the element for the drop down to open freely without being clipped by the edges of the browser. By default the drop down will try to open below the element. If the available space is not enough for the drop down to appear it will open in one of the following directions, if possible: top, over.
- "top" - The drop down opens above the element.
- "bottom" - The drop down opens under the element.
- "overlay-top" - The drop down opens above and over the element. The bottom edges of the drop down cover the element.
- "overlay-center" - The drop down opens at the center, over the element.
- "overlay-bottom" - The drop down opens under and over the element. The top edges of the drop down cover the element.
- "center-bottom" - The drop down opens at the center, below the element.
- "center-top" - The drop down opens at the center, over the element.
Default value
"auto"Example
Set the dropDownPosition property.
<smart-text-box drop-down-position='top'></smart-text-box>
Set the dropDownPosition property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.dropDownPosition = 'bottom';
Get the dropDownPosition property.
const textbox = document.querySelector('smart-text-box');
let dropDownPosition = textbox.dropDownPosition;
dropDownWidthstring | number
Specifies the width of the dropdown menu. By default, this property is set to an empty string (""). When left empty, the dropdown's width is determined by a corresponding CSS variable, allowing for flexible styling through external or theme-based CSS. To explicitly set a custom width, provide a valid CSS width value (e.g., "200px", "50%").
Default value
""Example
Set the dropDownWidth property.
<smart-text-box drop-down-width='auto'></smart-text-box>
Set the dropDownWidth property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.dropDownWidth = 500;
Get the dropDownWidth property.
const textbox = document.querySelector('smart-text-box');
let dropDownWidth = textbox.dropDownWidth;
escKeyMode"none" | "previousValue" | "clearValue"
Specifies how the element responds when the Escape key is pressed, such as closing a dialog, dismissing a modal, or performing a custom action.
Allowed Values
- "none" - Nothing happens on escape key.
- "previousValue" - The previous value is retrieved.
- "clearValue" - The value is cleared.
Default value
"none"Example
Set the escKeyMode property.
<smart-text-box esc-key-mode='contains'></smart-text-box>
Set the escKeyMode property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.escKeyMode = 'equals';
Get the escKeyMode property.
const textbox = document.querySelector('smart-text-box');
let escKeyMode = textbox.escKeyMode;
enterKeyBehavior"submit" | "clearOnSubmit"
Defines how the "Enter" key functions within the application, such as whether it submits a form, inserts a new line, or triggers a specific action, depending on the context.
Allowed Values
- "submit" - Submits the value.
- "clearOnSubmit" - Submits and clears the value.
Default value
"submit"Example
Set the enterKeyBehavior property.
<smart-text-box enter-key-behavior='newLine'></smart-text-box>
Set the enterKeyBehavior property by using the HTML Element's instance.
const textbox = document.querySelector('smart-text-box');
textbox.enterKeyBehavior = 'submit';
Get the enterKeyBehavior property.
const textbox = document.querySelector('smart-text-box');
let enterKeyBehavior = textbox.enterKeyBehavior;
formstring
Specifies the form element with which this element is associated, known as its "form owner." The value of this attribute must be the ID of a
ListItem
Defines a list item for ListBox, ComboBox, DropDownList.
Selector
smart-list-item
Properties
Properties
alternationIndexnumber
Default value
-1colorstring
Default value
""displayMode"plain" | "checkBox" | "radioButton"
Default value
"plain"groupedboolean
Default value
false<smart-list-item grouped></smart-list-item>
selectedboolean
Default value
false<smart-list-item selected></smart-list-item>
valuestring
Default value
""labelstring
Default value
""detailsstring
Default value
""groupstring
Default value
""hiddenboolean
Default value
false<smart-list-item hidden></smart-list-item>
readonlyboolean
Default value
false<smart-list-item readonly></smart-list-item>
ListItemsGroup
Defines a group of list items.
Selector
smart-list-items-group
Properties
Properties
labelstring