Skip to main content
Version: 4.3

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

ParameterTypeDescription
nameDefaultHandlesThe 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) },
},
],
}}
/>

Stay in the know

Be where thousands of diagramming enthusiasts meet

Star us on GitHub