# 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'
Or
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, eitherlong
(1000 ms) orshort
(35 ms). The default value islong
.
Example:
vibrator.vibrate({ mode: "short" });