pub struct TreeViewProps {
pub data: Option<Vec<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 TreeView component.
Tree View component for displaying hierarchical data
§Optional Props
- data:
Vec<TreeNode>- Tree data
- 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§
§data: Option<Vec<TreeNode>>Tree 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 TreeViewProps
impl TreeViewProps
Sourcepub fn builder() -> TreeViewPropsBuilder
pub fn builder() -> TreeViewPropsBuilder
Create a builder for building TreeViewProps.
On the builder, call .data(...)(optional), .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 TreeViewProps.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TreeViewProps
impl !RefUnwindSafe for TreeViewProps
impl Send for TreeViewProps
impl !Sync for TreeViewProps
impl Unpin for TreeViewProps
impl !UnwindSafe for TreeViewProps
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