pub enum LayoutTemplate {
Standard(StandardOptions),
Sidebar(SidebarOptions),
Split(SplitOptions),
Minimal(MinimalOptions),
Custom(Box<dyn LayoutProvider>),
CustomFn(LayoutFn),
}Expand description
Layout templates with customization options
Templates provide common layout patterns. Use Custom or CustomFn
for full control with ratatui.
Variants§
Standard(StandardOptions)
Standard vertical layout: chat (fills), panels, input, status bar
Sidebar(SidebarOptions)
Sidebar layout: main content + sidebar
Split(SplitOptions)
Split layout: two main areas side by side or stacked
Minimal(MinimalOptions)
Minimal layout: just chat and input, no status bar
Custom(Box<dyn LayoutProvider>)
Custom layout using a LayoutProvider implementation
CustomFn(LayoutFn)
Custom layout using a closure
Implementations§
Source§impl LayoutTemplate
impl LayoutTemplate
Sourcepub fn with_panels() -> Self
pub fn with_panels() -> Self
Create a standard layout with panels (permission, question, slash popup)
Create a sidebar layout
Sourcepub fn split_horizontal(
left_widget_id: &'static str,
right_widget_id: &'static str,
) -> Self
pub fn split_horizontal( left_widget_id: &'static str, right_widget_id: &'static str, ) -> Self
Create a horizontal split layout
Sourcepub fn split_vertical(
top_widget_id: &'static str,
bottom_widget_id: &'static str,
) -> Self
pub fn split_vertical( top_widget_id: &'static str, bottom_widget_id: &'static str, ) -> Self
Create a vertical split layout
Sourcepub fn custom<P: LayoutProvider>(provider: P) -> Self
pub fn custom<P: LayoutProvider>(provider: P) -> Self
Create a custom layout using a LayoutProvider
Sourcepub fn compute(
&self,
ctx: &LayoutContext<'_>,
sizes: &WidgetSizes,
) -> LayoutResult
pub fn compute( &self, ctx: &LayoutContext<'_>, sizes: &WidgetSizes, ) -> LayoutResult
Compute the layout for the given context
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LayoutTemplate
impl !RefUnwindSafe for LayoutTemplate
impl Send for LayoutTemplate
impl Sync for LayoutTemplate
impl Unpin for LayoutTemplate
impl !UnwindSafe for LayoutTemplate
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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