A toolbar attached to a node (React Flow's <NodeToolbar />).
Render it inside a custom node. It is shown while the node is selected
(or when is_visible says so) and positioned outside the node box.
Clicks on its buttons don't start a drag.
Examples
def my_node(assigns) do
~H"""
<LiveFlow.Components.NodeToolbar.node_toolbar node={@node} position={:top}>
<button phx-click="duplicate" phx-value-id={@node.id}>Duplicate</button>
<button phx-click="delete" phx-value-id={@node.id}>Delete</button>
</LiveFlow.Components.NodeToolbar.node_toolbar>
<div>{@node.data.label}</div>
"""
end
Summary
Functions
Renders the toolbar.
Functions
Renders the toolbar.
Attributes
:node- The node (required):is_visible- Force visibility; defaults tonode.selected:position-:top,:bottom,:leftor:right(default::top):align-:start,:centeror:end(default::center):offset- Gap between node and toolbar in pixels (default:10)
Attributes
node(:map) (required)is_visible(:boolean) - Defaults tonil.position(:atom) - Defaults to:top. Must be one of:top,:bottom,:left, or:right.align(:atom) - Defaults to:center. Must be one of:start,:center, or:end.offset(:integer) - Defaults to10.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)