getSelectionDefaultHandle()
function getSelectionDefaultHandle(name): SelectionHandle;
Builds a React SelectionHandle from a built-in ui.Selection
default handle ('remove', 'rotate', 'resize', 'clone'), with its
default tooltip applied. Lets React callers compose handles without importing
ui from @joint/plus.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | DefaultHandles | The built-in default handle name. |
Returns
The React handle config, ready to drop into the <Selection> wrapper.handles.
Example
import { Selection, getSelectionDefaultHandle } from '@joint/react-plus';
// Keep the built-in remove and clone handles, then add a custom one.
<Selection
wrapper={{
handles: [
getSelectionDefaultHandle('remove'),
getSelectionDefaultHandle('clone'),
{
name: 'count',
group: 'nw',
content: 'n',
events: { pointerdown: ({ collection }) => alert(collection.length) },
},
],
}}
/>