pub struct VStack;Expand description
Vertical stack container — children render top-to-bottom.
VStack renders nothing itself; it exists purely to group children.
Each child receives the full parent width and its own
desired_height.
This is the default layout direction and the implicit root of every renderer. Use it explicitly when you need a named group:
ⓘ
element! {
VStack {
Spinner(label: "Step 1...")
Spinner(label: "Step 2...")
}
}Trait Implementations§
Source§impl ChildCollector for VStack
impl ChildCollector for VStack
Source§impl Component for VStack
impl Component for VStack
Source§type State = ()
type State = ()
State type for this component. The framework wraps it in
Tracked<S> for automatic dirty detection.Source§fn render(&self, _area: Rect, _buf: &mut Buffer, _state: &())
fn render(&self, _area: Rect, _buf: &mut Buffer, _state: &())
Render into the given buffer region using current state.
Can use any ratatui Widget internally.
Source§fn desired_height(&self, _width: u16, _state: &()) -> u16
fn desired_height(&self, _width: u16, _state: &()) -> u16
How tall does this component want to be at the given width?
Source§fn handle_event_capture(
&self,
_event: &Event,
_state: &mut Tracked<Self::State>,
) -> EventResult
fn handle_event_capture( &self, _event: &Event, _state: &mut Tracked<Self::State>, ) -> EventResult
Handle an input event during the capture phase (root → focused). Read more
Source§fn handle_event(
&self,
_event: &Event,
_state: &mut Tracked<Self::State>,
) -> EventResult
fn handle_event( &self, _event: &Event, _state: &mut Tracked<Self::State>, ) -> EventResult
Handle an input event during the bubble phase (focused → root). Read more
Source§fn is_focusable(&self, _state: &Self::State) -> bool
fn is_focusable(&self, _state: &Self::State) -> bool
Whether this component can receive focus. Read more
Source§fn cursor_position(
&self,
_area: Rect,
_state: &Self::State,
) -> Option<(u16, u16)>
fn cursor_position( &self, _area: Rect, _state: &Self::State, ) -> Option<(u16, u16)>
Where to position the terminal’s hardware cursor when this
component has focus. Returns
(col, row) relative to the
component’s render area, or None to hide the cursor. Read moreSource§fn initial_state(&self) -> Option<Self::State>
fn initial_state(&self) -> Option<Self::State>
Create the initial state for this component. Read more
Source§fn content_inset(&self, _state: &Self::State) -> Insets
fn content_inset(&self, _state: &Self::State) -> Insets
Insets for the content area within this component’s render area. Read more
Source§fn width_constraint(&self) -> WidthConstraint
fn width_constraint(&self) -> WidthConstraint
Width constraint for this component within a horizontal container. Read more
Auto Trait Implementations§
impl Freeze for VStack
impl RefUnwindSafe for VStack
impl Send for VStack
impl Sync for VStack
impl Unpin for VStack
impl UnsafeUnpin for VStack
impl UnwindSafe for VStack
Blanket Implementations§
Source§impl<C> AddTo<Elements> for Cwhere
C: Component,
impl<C> AddTo<Elements> for Cwhere
C: Component,
Source§type Handle<'a> = ElementHandle<'a>
type Handle<'a> = ElementHandle<'a>
Handle returned after adding. Supports
.key() / .width() chaining.Source§fn add_to(self, els: &mut Elements) -> ElementHandle<'_>
fn add_to(self, els: &mut Elements) -> ElementHandle<'_>
Add this value to the collector, returning a handle for chaining
.key() and .width().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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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