Function: ButtonOrDropdownButton

ButtonOrDropdownButton<T>(props): Element

Use this primitive to create a toolbar button that can be either a button or a dropdown, depending on the number of items passed.

Type parameters

NameType
Textends string

Parameters

NameTypeDescription
propsObject-
props.childrenReactNodeThe contents of the button - usually an icon.
props.items{ label: string | Element ; value: T }[]The items to show in the dropdown.
props.onChoose(value: T) => voidThe function to execute when the button is clicked or an item is chosen from the dropdown. If there is only one item in the dropdown, the value will be an empty string.
props.titlestringThe title used for the tooltip.

Returns

Element