Skip to Content
组件Shell

Shell

Shell 是 Ansiq 里最重要的应用壳层 primitive 之一。

Shell
Shell 终端效果图
Shell 的终端效果图

最小示例

let app = Shell::new() .header(StatusBar::new("ansiq · ready").build()) .body(Paragraph::new("Main area").build()) .footer(Input::new().placeholder("Type here").build()) .build();

什么时候用

  • 你要稳定的 header / body / footer
  • 中间区域会变化,但上下区域要固定
  • 你在做 monitor、explorer、session UI

关键 builder 方法

  • Shell::new()
  • .header(...)
  • .body(...)
  • .footer(...)
  • .style(...)

重要说明

Shell 本身就是三槽布局,不是任意数量 children 的通用容器。

去哪里看真实用法

Last updated on