Skip to main content

Node

Function Node 

Source
pub fn Node<N, P, C, T>(props: NodeProps<N, P, C, T>) -> impl IntoView
where N: NodeId, P: PortId, C: ConnectionId, T: PortType,
Expand description

§Required Props

§Optional Props

  • _marker: PhantomData<(P, C, T)>
  • header: Children
    • Header content (title bar). Library measures its height.
  • body: Children
    • Body content (dropdowns, controls, etc.) between header and ports. Library measures its height.
  • inputs: impl Into<ViewFn>
    • Input port anchors (left column). Use ViewFn for reactive/dynamic ports.
  • outputs: impl Into<ViewFn>
    • Output port anchors (right column). Use ViewFn for reactive/dynamic ports.
  • accent_color: impl Into<MaybeProp<String>>
    • Per-node accent color (the top stripe). Reactive: accepts a String, a Signal<String>, or a closure. None/empty = no accent bar. Reactive so async-resolved colors (e.g. a node’s category/service color) update the stripe once they load.
  • header_color: impl Into<String>
    • Per-node header background override. When Some, overrides NodeStyle.header_background for this node only (e.g. category colors).
  • width: RwSignal<Option<f64>>
    • Explicit node width in pixels. None means “auto”: the node sizes from NodeStyle.width, or from its content above NodeStyle.min_width.

      Dragging the right-edge handle writes here, so pass a signal to own and persist what the user drags to. Omit it and the node keeps its own, which lives as long as the component does.