Skip to main content

ratatui_kit/components/
mod.rs

1// 适配器组件,用于桥接外部 widget 或自定义渲染逻辑。
2pub mod adapter;
3pub use adapter::*;
4// Fragment 透明容器组件,无额外布局节点,常用于包裹多个子元素。
5pub mod fragment;
6pub use fragment::*;
7// 视图容器组件,支持布局、嵌套、样式等,常用于包裹和组织子组件。
8pub mod view;
9pub use view::*;
10// 边框组件,为内容添加可定制的边框和标题。
11pub mod border;
12pub use border::*;
13// 模态框组件,支持弹窗、遮罩等交互场景。
14pub mod modal;
15pub use modal::*;
16// 滚动视图组件,支持内容滚动,适合长列表、文档阅读等。
17pub mod scroll_view;
18pub use scroll_view::*;
19// 上下文提供者组件,实现依赖注入和全局状态共享。
20mod context_provider;
21pub use context_provider::*;
22// 中心布局组件,用于居中布局,适合内容居中显示。
23pub mod center;
24pub use center::*;
25
26// 文本组件,用于显示文本内容,支持样式、超链接等。
27pub mod text;
28pub use text::*;
29
30// Block 的 Send + Sync 包装(ratatui 0.30 起 Block 因内含阴影效果不再 Send+Sync)。
31pub mod send_block;
32pub use send_block::*;
33
34// 定位组件,支持绝对定位,适合复杂布局需求。
35pub mod positioned;
36pub use positioned::*;
37
38#[cfg(feature = "input")]
39pub mod input;
40#[cfg(feature = "input")]
41pub use input::*;
42#[cfg(feature = "input")]
43pub use tui_input;
44
45#[cfg(feature = "tree")]
46pub mod tree_select;
47#[cfg(feature = "tree")]
48pub use tree_select::*;
49#[cfg(feature = "tree")]
50pub use tui_tree_widget;
51
52// 注:`textarea` 组件暂时下线(其底层 tui-textarea 尚无 ratatui 0.30 兼容版)。
53// 源码隔离保留在 `textarea.rs`(未声明为模块),待依赖支持 0.30 后恢复接入。
54
55#[cfg(feature = "router")]
56// 路由组件,支持页面跳转、参数、嵌套路由等,适合多页面终端应用。
57pub mod router;
58#[cfg(feature = "router")]
59pub use router::*;