use-long-press
Call function on long press
Source
Docs
Package
Usage
Definition
Restrict to specific input types
By default the long press is triggered by both mouse and touch input. Use the events
option to restrict it to a subset – for example, ['touch'] returns only touch handlers,
leaving mouse input to your own handlers:
Cancel on movement
Set cancelOnMove to cancel a pending long press when the pointer moves further than the
given distance from the start position. This is useful on touch devices so that a scroll
gesture does not trigger the long press. Pass true to use the default 10px threshold or a
number to set a custom one:
Exported types
UseLongPressEvent, UseLongPressOptions and UseLongPressReturnValue types are exported
from the @mantine/hooks package; you can import them in your application: