pub struct TreeNodeProps {
pub node: TreeNode,
pub show_icons: Option<bool>,
pub multiple: Option<bool>,
pub checkable: Option<bool>,
pub show_lines: Option<bool>,
pub show_node_icons: Option<bool>,
pub on_select: Option<Callback<TreeNode>>,
pub on_expand: Option<Callback<TreeNode>>,
pub on_check: Option<Callback<TreeNode>>,
pub class: Option<String>,
pub style: Option<String>,
pub children: Option<Box<dyn FnOnce() -> AnyView + Send>>,
}Expand description
Props for the [TreeNode] component.
Tree Node component
§Required Props
- node: [
TreeNode]- Node data
§Optional Props
- show_icons:
bool- Whether to show expand/collapse icons
- multiple:
bool- Whether to allow multiple selection
- checkable:
bool- Whether to allow checkbox selection
- show_lines:
bool- Whether to show lines connecting nodes
- show_node_icons:
bool- Whether to show node icons
- on_select:
Callback<TreeNode>- Callback when node is selected
- on_expand:
Callback<TreeNode>- Callback when node is expanded/collapsed
- on_check:
Callback<TreeNode>- Callback when node is checked/unchecked
- class:
String- Additional CSS classes
- style:
String- Inline styles
- children:
Children- Children content
Fields§
§node: TreeNodeNode data
show_icons: Option<bool>Whether to show expand/collapse icons
multiple: Option<bool>Whether to allow multiple selection
checkable: Option<bool>Whether to allow checkbox selection
show_lines: Option<bool>Whether to show lines connecting nodes
show_node_icons: Option<bool>Whether to show node icons
on_select: Option<Callback<TreeNode>>Callback when node is selected
on_expand: Option<Callback<TreeNode>>Callback when node is expanded/collapsed
on_check: Option<Callback<TreeNode>>Callback when node is checked/unchecked
class: Option<String>Additional CSS classes
style: Option<String>Inline styles
children: Option<Box<dyn FnOnce() -> AnyView + Send>>Children content
Implementations§
Source§impl TreeNodeProps
impl TreeNodeProps
Sourcepub fn builder() -> TreeNodePropsBuilder
pub fn builder() -> TreeNodePropsBuilder
Create a builder for building TreeNodeProps.
On the builder, call .node(...), .show_icons(...)(optional), .multiple(...)(optional), .checkable(...)(optional), .show_lines(...)(optional), .show_node_icons(...)(optional), .on_select(...)(optional), .on_expand(...)(optional), .on_check(...)(optional), .class(...)(optional), .style(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of TreeNodeProps.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TreeNodeProps
impl !RefUnwindSafe for TreeNodeProps
impl Send for TreeNodeProps
impl !Sync for TreeNodeProps
impl Unpin for TreeNodeProps
impl !UnwindSafe for TreeNodeProps
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