bubbletea
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBubbletea Documentation
Bubbletea 文档
Bubbletea is a Go framework for building terminal user interfaces based on The Elm Architecture.
Bubbletea 是一个基于 Elm 架构、用于构建终端用户界面的 Go 框架。
Key Resources
关键资源
When you need to understand Bubbletea patterns or find examples:
-
Examples README - Overview of all available examples: https://github.com/charmbracelet/bubbletea/blob/main/examples/README.md
-
Examples Directory - Full source code for all examples: https://github.com/charmbracelet/bubbletea/tree/main/examples
当你需要了解 Bubbletea 模式或查找示例时:
-
示例 README - 所有可用示例的概览: https://github.com/charmbracelet/bubbletea/blob/main/examples/README.md
-
示例目录 - 所有示例的完整源代码: https://github.com/charmbracelet/bubbletea/tree/main/examples
How to Use
使用方法
-
First, fetch the examples README to get an overview of available examples:
WebFetch https://github.com/charmbracelet/bubbletea/blob/main/examples/README.md -
Once you identify a relevant example, fetch its source code from the examples directory.
-
首先,获取示例 README 以了解所有可用示例的概览:
WebFetch https://github.com/charmbracelet/bubbletea/blob/main/examples/README.md -
确定相关示例后,从示例目录中获取其源代码。
Common Examples to Reference
常用参考示例
- - List component with filtering
list - - Table component
table - - Text input handling
textinput - - Multi-line text input
textarea - - Scrollable content
viewport - - Pagination
paginator - - Loading spinners
spinner - - Progress bars
progress - - Tab navigation
tabs - - Help text/keybindings display
help
- - 带过滤功能的列表组件
list - - 表格组件
table - - 文本输入处理
textinput - - 多行文本输入
textarea - - 可滚动内容
viewport - - 分页组件
paginator - - 加载动画
spinner - - 进度条
progress - - 标签页导航
tabs - - 帮助文本/快捷键显示
help
Core Concepts
核心概念
- Model: Application state
- Update: Handles messages and returns updated model + commands
- View: Renders the model to a string
- Cmd: Side effects that produce messages
- Msg: Events that trigger updates
- Model:应用状态
- Update:处理消息并返回更新后的模型 + 命令
- View:将模型渲染为字符串
- Cmd:产生消息的副作用
- Msg:触发更新的事件
Related Charm Libraries
相关 Charm 库
- Bubbles: Pre-built components (github.com/charmbracelet/bubbles)
- Lipgloss: Styling and layout (github.com/charmbracelet/lipgloss)
- Glamour: Markdown rendering (github.com/charmbracelet/glamour)
- Bubbles:预构建组件(github.com/charmbracelet/bubbles)
- Lipgloss:样式与布局(github.com/charmbracelet/lipgloss)
- Glamour:Markdown 渲染(github.com/charmbracelet/glamour)