New to KendoReactStart a free 30-day trial

Represents the props of the KendoReact DropDownList component.

Definition

Package:@progress/kendo-react-dropdowns

Properties

Specifies the accessKey of the DropDownList.

Example:
jsx
<DropDownList accessKey="d" />

adaptive?

boolean

Providing different rendering of the popup element based on the screen dimensions.

Default:

false

Example:
jsx
<DropDownList adaptive={true} />

Specifies the text that is rendered as subtitle in the adaptive popup(action sheet). Applicable only when adaptive is set to true.

Example:
jsx
<DropDownList adaptiveSubtitle="Adaptive Popup Subtitle" />

</ApiMemberSubSectionBody>

Specifies the text that is rendered as title in the adaptive popup(action sheet). Applicable only when adaptive is set to true. If not provided, the title will be the same as the label.

Example:
jsx
<DropDownList adaptiveTitle="Adaptive Popup Title" />

Identifies the element(s) which will describe the component, similar to HTML aria-describedby attribute. For example these elements could contain error or hint message.

Example:
jsx
<DropDownList ariaDescribedBy="error-message-id" />

The accessible label of the component. By default is set to value of label prop.

Example:
jsx
<DropDownList ariaLabel="Accessible Label" />

Identifies the element(s) which will label the component.

Example:
jsx
<DropDownList ariaLabelledBy="label-id" />

Sets additional classes to the DropDownList.

Example:
jsx
<DropDownList className="custom-class" />

data?

any[]

Sets the data of the DropDownList (see example).

Example:
jsx
<DropDownList data={['Item1', 'Item2', 'Item3']} />

Sets the key for comparing the data items of the DropDownList. If dataItemKey is not set, the DropDownList compares the items by reference (see example).

Example:
jsx
<DropDownList dataItemKey="id" />

Sets the text of the default empty item. The type of the defined value has to match the data type.

Example:
jsx
<DropDownList defaultItem="Select an item" />

Sets the default value of the DropDownList (see example). Similar to the native select HTML element.

Example:
jsx
<DropDownList defaultValue="Item1" />

delay?

number

Sets the delay before an item search is performed. When filtration is disabled, use this option.

Example:
jsx
<DropDownList delay={300} />

dir?

string

Represents the dir HTML attribute.

Example:
jsx
<DropDownList dir="rtl" />

disabled?

boolean

Sets the disabled state of the DropDownList.

Example:
jsx
<DropDownList disabled={true} />

fillMode?

"solid" | "flat" | "outline"

Configures the fillMode of the DropDownList.

The available options are:

  • solid
  • flat
  • outline
Default:

undefined (theme-controlled)

Example:
jsx
<DropDownList fillMode="flat" />

filter?

string

Sets the value of filtering input. Useful for making the filtering input a controlled component.

Example:
jsx
<DropDownList filter="search text" />

Enables the filtering functionality of the DropDownList (more information and examples).

Example:
jsx
<DropDownList filterable={true} />

If set, the DropDownList will use it to get the focused item index.

Default functionality returns the first item which starts with the input text.

Parameters:dataanyinputTextstringtextField?stringReturns:

number

Example:
jsx
const focusedItemIndex = (data, inputText, textField) => {
    let text = inputText.toLowerCase();
    return data.findIndex(item =>
        String(textField ? item[textField] : item).toLowerCase().includes(text));
};

<DropDownList focusedItemIndex={focusedItemIndex} />

ReactNode

Sets the footer component of the DropDownList (see example).

Example:
jsx
<DropDownList footer={<div>Footer Content</div>} />

Sets the data item field that represents the start of a group. Applicable to objects data.

Example:
jsx
<DropDownList groupField="category" />

Fires when a DropDownList's group header item is about to be rendered. Used to override the default appearance of the group's headers.

Parameters:liReactElement​<HTMLLIElement, string | JSXElementConstructor​<any>>itemPropsListGroupItemPropsReturns:

ReactNode

Example:
jsx
<DropDownList groupHeaderItemRender={(li, itemProps) => <li>{itemProps.dataItem}</li>} />

Fires when a DropDownList's sticky group header item is about to be rendered. Used to override the default appearance of the sticky group header of the component.

Parameters:divReactElement​<HTMLDivElement, string | JSXElementConstructor​<any>>stickyHeaderPropsGroupStickyHeaderPropsReturns:

ReactNode

Example:
jsx
<DropDownList groupStickyHeaderItemRender={(div, stickyHeaderProps) => <div>{stickyHeaderProps.dataItem}</div>} />

ReactNode

Sets the header component of the DropDownList (see example).

Example:
jsx
<DropDownList header={<div>Header Content</div>} />

Sets CSS classes to the expand icon DOM element.

Example:
jsx
<DropDownList iconClassName="custom-icon-class" />

id?

string

Specifies the id of the component.

Example:
jsx
<DropDownList id="dropdown-id" />

Enables a case-insensitive search. When filtering is disabled, use this option.

Example:
jsx
<DropDownList ignoreCase={true} />

Fires when a DropDownList item is about to be rendered (see example). Used to override the default appearance of the list items.

Parameters:liReactElement​<HTMLLIElement, string | JSXElementConstructor​<any>>itemPropsListItemPropsReturns:

ReactNode

Example:
jsx
<DropDownList itemRender={(li, itemProps) => <li>{itemProps.dataItem}</li>} />

label?

string

Renders a floating label for the DropDownList.

Example:
jsx
<DropDownList label="Dropdown Label" />

If set to false, the DropDownList will not navigate over its data through left and right keys. Useful when the DropDownList is placed inside a toolbar which needs to handle left and right keys.

Example:
jsx
<DropDownList leftRightKeysNavigation={false} />

Fires when the element which indicates no data in the popup is about to be rendered (see example). Used to override the default appearance of the element.

Parameters:elementReactElement​<HTMLDivElement, string | JSXElementConstructor​<any>>Returns:

ReactNode

Example:
jsx
<DropDownList listNoDataRender={(element) => <div>No data available</div>} />

loading?

boolean

Sets the loading state of the DropDownList.

Example:
jsx
<DropDownList loading={true} />

name?

string

Specifies the name property of the select DOM element.

Example:
jsx
<DropDownList name="dropdown-name" />

Fires each time the DropDownList gets blurred.

Parameters:eventDropDownListBlurEvent
Example:
jsx
<DropDownList onBlur={(event) => console.log('Blurred')} />

Fires each time the value of the DropDownList is about to change (see examples).

Parameters:eventDropDownListChangeEvent
Example:
jsx
<DropDownList onChange={(event) => console.log('Value changed')} />

Fires each time the popup of the DropDownList is about to close.

Parameters:eventDropDownListCloseEvent
Example:
jsx
<DropDownList onClose={(event) => console.log('Popup closed')} />

Fires each time the user types in the filter input. You can filter the source based on the passed filtration value.

Parameters:eventDropDownListFilterChangeEvent
Example:
jsx
<DropDownList onFilterChange={(event) => console.log('Filter changed')} />

Fires each time the user focuses the DropDownList.

Parameters:eventDropDownListFocusEvent
Example:
jsx
<DropDownList onFocus={(event) => console.log('Focused')} />

Fires each time the popup of the DropDownList is about to open.

Parameters:eventDropDownListOpenEvent
Example:
jsx
<DropDownList onOpen={(event) => console.log('Popup opened')} />

Fires when both the virtual scrolling of the DropDownList is enabled and the component requires data for another page (see example).

Parameters:eventDropDownListPageChangeEvent
Example:
jsx
<DropDownList onPageChange={(event) => console.log('Page changed')} />

opened?

boolean

Sets the opened and closed state of the DropDownList.

Example:
jsx
<DropDownList opened={true} />

Configures the popup of the DropDownList.

Example:
jsx
<DropDownList popupSettings={{ animate: true }} />

required?

boolean

Specifies if null is a valid value for the component.

This property is part of the FormComponentProps interface.

rounded?

"small" | "medium" | "large" | "full" | "none"

Configures the roundness of the DropDownList.

The available options are:

  • small
  • medium
  • large
  • full
Default:

undefined (theme-controlled)

Example:
jsx
<DropDownList rounded="large" />

size?

"small" | "medium" | "large"

Configures the size of the DropDownList.

The available options are:

  • small
  • medium
  • large
Default:

undefined (theme-controlled)

Example:
jsx
<DropDownList size="small" />

Defines if DropDownList's disabled items will be skipped or focused when navigating through the list of items using a keyboard. Defaults to true.

Example:
jsx
<DropDownList skipDisabledItems={false} />

style?

CSSProperties

The styles that are applied to the DropDownList.

Example:
jsx
<DropDownList style={{ width: '200px' }} />

svgIcon?

SVGIcon

Sets the specified SVG icon.

Example:
jsx
<DropDownList svgIcon={{ name: 'custom-icon' }} />

tabIndex?

number

Specifies the tabIndex of the DropDownList.

Example:
jsx
<DropDownList tabIndex={0} />

Sets the data item field that represents the item text (see example). If the data contains only primitive values, do not define it.

Example:
jsx
<DropDownList textField="name" />

title?

string

Sets the title attribute to the DropDownList DOM element.

Example:
jsx
<DropDownList title="Dropdown Title" />

valid?

boolean

Overrides the validity state of the component. If valid is set, the required property will be ignored.

This property is part of the FormComponentProps interface.

Controls the form error message of the component. If set to an empty string, no error will be thrown.

This property is part of the FormComponentProps interface.

If set to false, no visual representation of the invalid state of the component will be applied.

This property is part of the FormComponentProps interface.

Sets the value of the DropDownList (see example). It can either be of the primitive (string, numbers) or of the complex (objects) type.

Example:
jsx
<DropDownList value="Item1" />

Represents a callback function, which returns the value for submitting. The returned value will be rendered in an option of a hidden select element.

Parameters:valueanyReturns:

any

Example:
jsx
const App = () => {
   return (
      <form>
          <DropDownList
              data={[ { text: "Austria", id: 1 } , { text: "Belarus", id: 2 } ]}
              valueMap={value => value && value.id}
          />
          <Button type="submit">Submit</Button>
      </form>
   );
}

Fires when the element which renders the value is about to be rendered (see example). Used to override the default appearance of the element.

Parameters:elementReactElement​<HTMLSpanElement, string | JSXElementConstructor​<any>>valueanyReturns:

ReactNode

Example:
jsx
<DropDownList valueRender={(element, value) => <span>{value}</span>} />

Configures the virtual scrolling of the DropDownList (see example).

Example:
jsx
<DropDownList virtual={{ pageSize: 20 }} />

webMcp?

boolean | WebMcpProps

Enables Web MCP tool registration for this component. Requires a parent WebMcpProvider from @progress/kendo-react-webmcp.