ratatui_kit/components/
view.rs1use ratatui_kit_macros::{Props, with_layout_style};
15
16use crate::{AnyElement, Component};
17
18#[with_layout_style]
19#[derive(Default, Props)]
20pub struct ViewProps<'a> {
22 pub children: Vec<AnyElement<'a>>,
24}
25
26pub struct View;
28
29impl Component for View {
30 type Props<'a> = ViewProps<'a>;
31
32 fn new(_props: &Self::Props<'_>) -> Self {
33 Self
34 }
35
36 fn update(
37 &mut self,
38 props: &mut Self::Props<'_>,
39 _hooks: crate::Hooks,
40 updater: &mut crate::ComponentUpdater,
41 ) {
42 updater.set_layout_style(props.layout_style());
43 updater.update_children(&mut props.children, None);
44 }
45}