Skip to main content

useHaptics

useHaptics is a hook that plays app-configured touch feedback, such as a selection tick or confirmation after saving.

Import

import { useHaptics } from '@vortexlabs/vortex-native';
import { useHaptics } from "@vortexlabs/vortex-native";
import { Pressable, Text } from "react-native";

export const SelectOption = () => {
  const haptics = useHaptics();

  return (
    <Pressable onPress={() => haptics.selection()} role="button">
      <Text>Select option</Text>
    </Pressable>
  );
};

Features

  • Returns the adapter configured on VortexProvider.
  • Plays selection, impact, and notification feedback.
  • Keeps calls safe when feedback is disabled or unavailable.

Choose an adapter in the provider setup and test it on a device with haptics.