# Vibration

Vibration management.

# Manifest Declaration

You need to declare the use of this API in the manifest's features member:

{"name": "system.vibrator"}

# Module Import

Before using this service in a component, you need to import the module in the script section of the UX document.

import vibrator from '@system.vibrator' 


let vibrator = require("@system.vibrator")

# Methods

This service has the following methods:

# vibrate({mode})

Triggers vibration up to 1 second..

# Arguments

This method requires an object with the following attributes:

  • mode (string). Optional attribute indicating the vibration mode, either long (1000 ms) or short (35 ms). The default value is long.


vibrator.vibrate({ mode: "short" });