Skip to content

isKeyboardVisible

isKeyboardVisible is a utility function that checks whether the on-screen keyboard is currently visible. This function uses getKeyboardHeight() internally and returns true if the keyboard height is greater than 0.

Interface

ts
function isKeyboardVisible(): boolean;

Parameters

Return Value

  • boolean

    if the keyboard is visible, false otherwise.

Example

tsx
if (isKeyboardVisible()) {
  console.log('Keyboard is open');
} else {
  console.log('Keyboard is closed');
}

Released under the MIT License.