pub struct NodeProps<N, P, C, T>{
pub id: N,
pub position: RwSignal<Position>,
pub _marker: PhantomData<(P, C, T)>,
pub header: Option<Children>,
pub body: Option<Children>,
pub inputs: ViewFn,
pub outputs: ViewFn,
pub accent_color: MaybeProp<String>,
pub header_color: Option<String>,
pub width: Option<RwSignal<Option<f64>>>,
}Expand description
Props for the Node component.
§Required Props
- id: [
N] - position:
RwSignal<Position>
§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, aSignal<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.
- Per-node accent color (the top stripe). Reactive: accepts a
- header_color:
impl Into<String>- Per-node header background override. When
Some, overridesNodeStyle.header_backgroundfor this node only (e.g. category colors).
- Per-node header background override. When
- width:
RwSignal<Option<f64>>-
Explicit node width in pixels.
Nonemeans “auto”: the node sizes fromNodeStyle.width, or from its content aboveNodeStyle.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.
-
Fields§
§id: N§position: RwSignal<Position>§_marker: PhantomData<(P, C, T)>§header: Option<Children>Header content (title bar). Library measures its height.
body: Option<Children>Body content (dropdowns, controls, etc.) between header and ports. Library measures its height.
inputs: ViewFnInput port anchors (left column). Use ViewFn for reactive/dynamic ports.
outputs: ViewFnOutput port anchors (right column). Use ViewFn for reactive/dynamic ports.
accent_color: 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: Option<String>Per-node header background override. When Some, overrides
NodeStyle.header_background for this node only (e.g. category colors).
width: Option<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.
Implementations§
Source§impl<N, P, C, T> NodeProps<N, P, C, T>
impl<N, P, C, T> NodeProps<N, P, C, T>
Sourcepub fn builder() -> NodePropsBuilder<N, P, C, T, ((), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> NodePropsBuilder<N, P, C, T, ((), (), (), (), (), (), (), (), (), ())>
Create a builder for building NodeProps.
On the builder, call .id(...), .position(...), ._marker(...)(optional), .header(...)(optional), .body(...)(optional), .inputs(...)(optional), .outputs(...)(optional), .accent_color(...)(optional), .header_color(...)(optional), .width(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of NodeProps.
Trait Implementations§
Auto Trait Implementations§
impl<N, P, C, T> !RefUnwindSafe for NodeProps<N, P, C, T>
impl<N, P, C, T> !Sync for NodeProps<N, P, C, T>
impl<N, P, C, T> !UnwindSafe for NodeProps<N, P, C, T>
impl<N, P, C, T> Freeze for NodeProps<N, P, C, T>
impl<N, P, C, T> Send for NodeProps<N, P, C, T>
impl<N, P, C, T> Unpin for NodeProps<N, P, C, T>
impl<N, P, C, T> UnsafeUnpin for NodeProps<N, P, C, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more