Back to Mantine

Use Text Selection

apps/mantine.dev/src/pages/hooks/use-text-selection.mdx

9.3.1368 B
Original Source

import { UseTextSelectionDemos } from '@docs/demos'; import { Layout } from '@/layout'; import { MDX_DATA } from '@/mdx';

export default Layout(MDX_DATA.useTextSelection);

Usage

The use-text-selection hook returns the current text selection:

<Demo data={UseTextSelectionDemos.usage} />

Definition

tsx
function useTextSelection(): Selection | null;