Skip to content

Events

PropertyTypeDescription
onChangefunction(optional) (preferred) this event gets triggered once the tab changes its selected key. Returns { key, selectedKey, focusKey, event }.
onClickfunction(optional) This event gets triggered once the tab gets clicked. Returns { key, selectedKey, focusKey, event }.
onFocusfunction(optional) This event gets triggered once the tab changes its focus key. Returns { key, selectedKey, focusKey, event }.
onMouseEnterfunction(optional) This event gets triggered once the user';s mouse enters a tab (hover). Returns { key, selectedKey, focusKey, event }.

Prevent a change

You can prevent a change from happening by returning false on the onClick event handler:

<Tabs
onClick={() => {
if (condition === true) {
return false
}
}}
onChange={() => {
// Will not get emitted
}}
/>