New to KendoReactStart a free 30-day trial

Represents the props of the KendoReact AutoComplete component.

Definition

Package:@progress/kendo-react-dropdowns

Properties

Specifies the accessKey of the AutoComplete.

Example:
jsx
<AutoComplete accessKey="a" />

adaptive?

boolean

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

Default:

false

Example:
jsx
<AutoComplete 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
<AutoComplete adaptiveSubtitle="Adaptive Popup Subtitle" />

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
<AutoComplete 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
<AutoComplete ariaDescribedBy="description" />

Defines a string value that labels the component.

Example:
jsx
<AutoComplete ariaLabel="Search" />

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

Example:
jsx
<AutoComplete ariaLabelledBy="label" />

Sets additional classes to the AutoComplete.

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

By default, the AutoComplete renders a button on hovering over the component, which resets the value. If clearButton is set to false, the button will not be rendered.

Example:
jsx
<AutoComplete clearButton={false} />

data?

any[]

Sets the data of the AutoComplete (more information and example).

Example:
jsx
<AutoComplete data={['Apple', 'Orange', 'Banana']} />

Sets the key for comparing the data items of the AutoComplete. If dataItemKey is not set, the AutoComplete compares the items by reference.

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

Sets the default value of the AutoComplete. Similar to the native input HTML element.

Example:
jsx
<AutoComplete defaultValue="Orange" />

dir?

string

Represents the dir HTML attribute.

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

disabled?

boolean

Sets the disabled state of the AutoComplete.

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

fillMode?

"solid" | "flat" | "outline"

Configures the fillMode of the AutoComplete.

The available options are:

  • solid
  • flat
  • outline
Default:

undefined (theme-controlled)

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

If set, the AutoComplete 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));
};

<AutoComplete focusedItemIndex={focusedItemIndex} />

ReactNode

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

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

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

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

Fires when a AutoComplete 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
<AutoComplete groupHeaderItemRender={(li, itemProps) => <li>{itemProps.dataItem}</li>} />

Fires when a AutoComplete 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
<AutoComplete groupStickyHeaderItemRender={(div, stickyHeaderProps) => <div>{stickyHeaderProps.dataItem}</div>} />

ReactNode

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

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

id?

string

Specifies the id of the component.

Example:
jsx
<AutoComplete id="autocomplete" />

inputAttributes?

InputHTMLAttributes​<HTMLInputElement>

Sets the HTML attributes of the inner focusable input element. Attributes which are essential for certain component functionalities cannot be changed.

Example:
jsx
<AutoComplete inputAttributes={{ maxLength: 10 }} />

Fires when an AutoComplete list 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
<AutoComplete itemRender={(li, itemProps) => <li>{itemProps.dataItem}</li>} />

label?

string

Renders a floating label for the AutoComplete.

Example:
jsx
<AutoComplete label="Search" />

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
<AutoComplete listNoDataRender={(element) => <div>No data available</div>} />

loading?

boolean

Sets the loading state of the AutoComplete (see example).

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

name?

string

Specifies the name property of the input DOM element.

This property is part of the FormComponentProps interface.

Fires each time the AutoComplete gets blurred.

Parameters:eventAutoCompleteBlurEvent
Example:
jsx
<AutoComplete onBlur={(event) => console.log('Blurred', event)} />

Fires each time the value of the AutoComplete is about to change (more information and example).

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

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

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

Fires each time the user focuses the AutoComplete.

Parameters:eventAutoCompleteFocusEvent
Example:
jsx
<AutoComplete onFocus={(event) => console.log('Focused', event)} />

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

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

opened?

boolean

Sets the opened and closed state of the AutoComplete.

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

The hint that is displayed when the AutoComplete is empty.

Example:
jsx
<AutoComplete placeholder="Type here..." />

Configures the popup of the AutoComplete.

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

prefix?

CustomComponent​<any>

Sets a custom prefix to the AutoComplete component.

Example:
jsx
<AutoComplete prefix={<span>Prefix</span>} />

readonly?

boolean

Sets the read-only state of the AutoComplete.

Example:
jsx
<AutoComplete readonly={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 AutoComplete.

The available options are:

  • small
  • medium
  • large
  • full
Default:

undefined (theme-controlled)

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

size?

"small" | "medium" | "large"

Configures the size of the AutoComplete.

The available options are:

  • small
  • medium
  • large
Default:

undefined (theme-controlled)

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

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

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

style?

CSSProperties

The styles that are applied to the AutoComplete.

Example:
jsx
<AutoComplete style={{ width: '300px' }} />

suffix?

CustomComponent​<any>

Sets a custom suffix to the AutoComplete component.

Example:
jsx
<AutoComplete suffix={<span>Suffix</span>} />

suggest?

string | boolean

Enables the auto-completion of the text based on the first data item (see example).

Example:
jsx
<AutoComplete suggest={true} />

tabIndex?

number

Specifies the tabIndex of the AutoComplete.

Example:
jsx
<AutoComplete 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
<AutoComplete textField="name" />

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.

value?

string

Sets the value of the AutoComplete (more information and example).

Example:
jsx
<AutoComplete value="Apple" />

Fires when the AutoComplete input element is about to be rendered. Use it to override the default appearance of the component.

Parameters:renderingReactElement​<HTMLSpanElement, string | JSXElementConstructor​<any>>Returns:

ReactNode

Example:
jsx
<AutoComplete valueRender={(rendering) => <span>{rendering}</span>} />

webMcp?

boolean | WebMcpProps

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