packages/hooks/src/useTextSelection/index.en-US.md
Tracking content, size, position of user text selection.
const state = useTextSelection(target?);
| Property | Description | Type | Default |
|---|---|---|---|
| target | DOM element or ref | Element | Document | (() => Element\Document) | MutableRefObject<Element> | document |
| Property | Description | Type |
|---|---|---|
| state | Content, size, position of user text selection | State |
| Property | Description | Type |
|---|---|---|
| text | Selected text | string |
| left | The left coordinate value of text | number |
| right | The right coordinate value of text | number |
| top | The top coordinate value of text | number |
| bottom | The bottom coordinate value of text | number |
| height | The height of text | number |
| width | The width of text | number |