node package manager



Tap the side of the smart device (qick shake trigger) to display a UI Modal for A-Frame VR.


Integrated Shake.js - JavaScript plugin for mobile web browsers using device accelerometer.

Author: Alex Gibson

Modified aframe-ui-modal-component

Author: IdeaSpace


Property Description Default Value
trigger Event to make dialog or menu visible: 'shake' or 'click' 'shake'
threshold Default for shake velocity threshold for shake to register 5
timeout Default for shake interval between events. 500
zpos Position the dialog or menu on the z-axis. In meters. -0.85
xoffset Position offset value on the x-axis from center. In meters. 0
yoffset Position offset value on the y-axis from center. In meters. 0



Browser Installation

Install and use by directly including the browser files:

  <title>My A-Frame Scene</title>
  <script src=""></script> 
  <script src=""></script> 
   <a-entity shake2show visible="false"></a-entity>
   <a-entity camera look-controls></a-entity>

NPM Installation

Install via NPM:

npm install aframe-shake2show-component

Then register and use.


In browser testing

For console testing on desktop trigger shake event

var triggerShake = document.createEvent("HTMLEvents");
triggerShake.initEvent("shake", true, true);
function shakeMe(){


You need a camera component in your scene.

Your web browser must support the devicemotion event for this plugin to work. Shake.js uses built-in feature detection to determine if it can run in your web browser. It will terminate silently on non-supporting browsers.

Supported web browsers/devices

  • iOS Safari 4.2.1 (and above)
  • Android 4.0.3 (default browser)
  • Chrome 41+ for Android
  • Opera Mobile (Android)
  • BlackBerry PlayBook 2.0
  • Firefox for Android
  • FirefoxOS Devices