> For the complete documentation index, see [llms.txt](https://minwork.gitbook.io/long-press-hook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://minwork.gitbook.io/long-press-hook/basics.md).

# Basics

Basic hook usage

Basic hook usage example to get started immediately

```tsx
import React from 'react'; // No longer necessary in newer React versions
import { useLongPress } from 'use-long-press';

const Example = () => {
  const bind = useLongPress(() => {
    alert('Long pressed!');
  });

  return <button {...bind()}>Press me</button>;
};
```
