Custom RenderingPremium
The ComboBox provides options for customizing the way it renders its elements.
The ComboBox utilizes custom renderers which enable you to moderate the content of its:
Items
To customize the content of each suggestion list item, use the itemRender prop.
The following example demonstrates how to set the itemRender prop of the ComboBox and customize the list elements.
The
itemRenderfunction receives the defaultlielement as its first argument. This element carries the click handling and the selected, focused, and disabled states of the item. To keep the items selectable, return a clone of the received element withReact.cloneElement(li, li.props, children)instead of a newlielement.
Values
To customize the element content that holds the selected text, use the valueRender prop.
Headers and Footers
To set a header or a footer element in the items popup of the ComboBox, use the header and footer props.
No Data
To customize the content of the suggestion list when no data is present, use the listNoDataRender prop.