Returns the ARIA/accessibility props that make a non-button HTML element keyboard-navigable and screen-reader-accessible as a button.
Spread these onto the element alongside onClick and onKeyDown:
onClick
onKeyDown
<div {...buttonKeyboardProps(label)} onClick={handler} onKeyDown={e => isActivationKey(e) && handler()} /> Copy
<div {...buttonKeyboardProps(label)} onClick={handler} onKeyDown={e => isActivationKey(e) && handler()} />
Returns the ARIA/accessibility props that make a non-button HTML element keyboard-navigable and screen-reader-accessible as a button.
Spread these onto the element alongside
onClickandonKeyDown: