@knitui/hooks
useKeyboardActions
Keyboard/accessibility activation for an interactive host that is NOT a native <button> — web implementation. Returns { tabIndex, onKeyDown } to spread onto the host so it is focusable and the configured {@link KeyboardActions} fire from the keyboard. The use-keyboard-actions.native sibling maps the same intents to React Native accessibility actions instead. The onKeyDown identity is stable across renders (it reads the latest actions through a ref), so spreading it does not churn the host. A key with no binding passes through to the browser, and a chord with Ctrl/Alt/Meta held is ignored so browser/OS shortcuts keep working. A matched key is preventDefault()ed so Space does not scroll and arrows do not pan the page.
WebiOSAndroidnative split
Import
import { useKeyboardActions } from "@knitui/hooks";Signature
export function useKeyboardActions( actions: KeyboardActions, options: UseKeyboardActionsOptions = {}, ): KeyboardActionProps