Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including ionic-plugin-keyboard with all npm packages installed. Try it out:

ionic-plugin-keyboard lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

// require("ionic-plugin-keyboard/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

ionic-plugin-keyboard v2.2.1

Ionic Keyboard Plugin


The cordova.plugins.Keyboard object provides functions to make interacting with the keyboard easier, and fires events to indicate that the keyboard will hide/show.

cordova plugin add ionic-plugin-keyboard


  • cordova.plugins.Keyboard.hideKeyboardAccessoryBar
  • cordova.plugins.Keyboard.close
  • cordova.plugins.Keyboard.disableScroll


  • cordova.plugins.Keyboard.isVisible


These events are fired on the window.

  • native.keyboardshow
    • A number keyboardHeight is given on the event object, which is the pixel height of the keyboard.
  • native.keyboardhide

API reference


Hide the keyboard accessory bar with the next, previous and done buttons.


Supported Platforms

  • iOS


Close the keyboard if it is open.


Supported Platforms

  • iOS, Android, Blackberry 10, Windows


Prevent the native UIScrollView from moving when an input is focused. The telltale sign that this is happening is the top of your app scrolls out of view (if using Ionic, your header bar will disappear).

This does not prevent any DOM elements from being able to scroll. That needs to happen from CSS and JavaScript, not this plugin.


Supported Platforms

  • iOS, Windows

Force keyboard to be shown. This typically helps if autofocus on a text element does not pop up the keyboard automatically;

Supported Platforms

  • Android, Blackberry 10, Windows


This event fires when the keyboard will be shown or when the keyboard frame resizes (when switching between keyboards for example)

window.addEventListener('native.keyboardshow', keyboardShowHandler);

function keyboardShowHandler(e){
    alert('Keyboard height is: ' + e.keyboardHeight);


keyboardHeight: the height of the keyboard in pixels

Supported Platforms

  • iOS, Android, Blackberry 10, Windows


This event fires when the keyboard will hide

window.addEventListener('native.keyboardhide', keyboardHideHandler);

function keyboardHideHandler(e){
    alert('Goodnight, sweet prince');



Supported Platforms

  • iOS, Android, Blackberry 10, Windows


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free