Skip to content

useTextSelection ​

sensors
test coverage
Last changed: 28 days ago

TIP

This hook uses document.getSelection browser api to provide enhanced functionality. Make sure to check for compatibility with different browsers when using this api

Hook that manages the text selection

typescript
import { useTextSelection } from '@siberiacancode/reactuse';

Usage ​

typescript
const selection = useTextSelection();

Demo ​

Api ​

Source ​

Source • Demo

Contributors ​

Avatardebabin
Avatarhywax

Released under the MIT License.