Skip to main content

Halo and Selection

There are several canvas widget components which can be used to display actions on the selected diagram elements or links.

Selecting elements

<Halo /> widget allows selecting a single element to perform an element action on it.

<Selection /> widget allows selecting more than one element via rectangular selection box to move them together and perform an element action on them.

There are several built-in element actions that can be used:

Action componentDescription
<SelectionAction />Base component to display a custom element action.
<SelectionActionSpinner />Displays a loading spinner (useful as building block for other action components).
<SelectionActionRemove />Removes an element from the diagram.
<SelectionActionZoomToFit />Zooms-in or zooms-out the viewport to fit all selected elements.
<SelectionActionLayout />Performs graph layout algorithm on the sub-graph formed from the selected elements.
<SelectionActionExpand />Toggles expanded state for the selected elements.
<SelectionActionAnchor />Displays a link to the entity IRI.
<SelectionActionConnections />Opens the connections menu for the selected entities.
<SelectionActionAddToFilter />Adds the selected entity to the instances search filter.
<SelectionActionGroup />Groups or ungroups selected elements.
<SelectionActionEstablishLink />Starts creating a relation to an existing or a new entity by dragging it.

<HaloLink /> widget allows selecting a single link to perform a link action on it.

There are several built-in link actions that can be used:

Action componentDescription
<LinkAction />Base component to display an action on the selected link.
useLinkActionContext() hook can be used to get additional context for the selected link, including path geometry.
<LinkActionSpinner />Displays a loading spinner (useful as building block for other action components).
<LinkActionEdit />Starts editing the relation.
<LinkActionDelete />Deletes the relation.
<LinkActionMoveEndpoint />Displays a handle which allows to change the relation by moving its endpoint (source or target) to another entity.
<LinkActionRename />Starts renaming a link (change the label on the diagram only).

Styles

The component look can be customized using the following CSS properties (see design system for more information):

PropertyDescription
--reactodia-selection-icon-filterCSS filter for the element selection action icons.
--reactodia-selection-multiple-box-shadowBox shadow for the selection rectangle with multiple elements.
--reactodia-selection-single-box-shadowBox shadow for the selection rectangle with a single element.