Skip to main content
Version: 4.3

getHaloDefaultHandle()

function getHaloDefaultHandle(name): HaloHandle;

Builds a React HaloHandle from a built-in ui.Halo default handle ('remove', 'resize', 'rotate', 'fork', 'clone', 'link', 'unlink', 'direction'), 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 <Halo handles> prop.

Example

import { GraphProvider, Paper, Halo, getHaloDefaultHandle } from '@joint/react-plus';

// Keep only the remove and clone handles, relabel the remove button.
<GraphProvider>
<Paper
renderElement={() => (
<Halo
handles={[
{ ...getHaloDefaultHandle('remove'), title: 'Delete' },
getHaloDefaultHandle('clone'),
]}
/>
// Your element rendering here...
)}
/>
</GraphProvider>;

Stay in the know

Be where thousands of diagramming enthusiasts meet

Star us on GitHub