diff --git a/docs/vibration.md b/docs/vibration.md
index ed300e9c547..dfc1f2980c1 100644
--- a/docs/vibration.md
+++ b/docs/vibration.md
@@ -7,6 +7,108 @@ Vibrates the device.
## Example
+
+
+ -
+ Function Component Example
+
+ -
+ Class Component Example
+
+
+
+
+
+
+```SnackPlayer name=Vibration&supportedPlatforms=ios,android
+import React from "react";
+import { Button, Platform, Text, Vibration, View, SafeAreaView, StyleSheet } from "react-native";
+
+function Separator() {
+ return ;
+}
+
+const App = () => {
+
+ const ONE_SECOND_IN_MS = 1000;
+
+ const PATTERN = [
+ 1 * ONE_SECOND_IN_MS,
+ 2 * ONE_SECOND_IN_MS,
+ 3 * ONE_SECOND_IN_MS
+ ];
+
+ const PATTERN_DESC =
+ Platform.OS === "android"
+ ? "wait 1s, vibrate 2s, wait 3s"
+ : "wait 1s, vibrate, wait 2s, vibrate, wait 3s";
+
+ return (
+
+ Vibration API
+
+
+
+ {Platform.OS == "android"
+ ? [
+
+ ,
+
+ ]
+ : null}
+ Pattern: {PATTERN_DESC}
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: "center",
+ paddingTop: 44,
+ padding: 8
+ },
+ header: {
+ fontSize: 18,
+ fontWeight: "bold",
+ textAlign: "center"
+ },
+ paragraph: {
+ margin: 24,
+ textAlign: "center"
+ },
+ separator: {
+ marginVertical: 8,
+ borderBottomColor: "#737373",
+ borderBottomWidth: StyleSheet.hairlineWidth
+ }
+});
+
+export default App
+```
+
+
+
```SnackPlayer name=Vibration&supportedPlatforms=ios,android
import React from "react";
import { Button, Platform, Text, Vibration, View, SafeAreaView, StyleSheet } from "react-native";
@@ -93,6 +195,8 @@ const styles = StyleSheet.create({
});
```
+
+
> Android apps should request the `android.permission.VIBRATE` permission by adding `` to `AndroidManifest.xml`.
> The Vibration API is implemented as a `AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)` call on iOS.