{"id":13409780,"url":"https://github.com/charmbracelet/bubbles","last_synced_at":"2025-05-12T22:23:52.044Z","repository":{"id":37038001,"uuid":"234757030","full_name":"charmbracelet/bubbles","owner":"charmbracelet","description":"TUI components for Bubble Tea 🫧","archived":false,"fork":false,"pushed_at":"2025-05-05T09:40:47.000Z","size":1183,"stargazers_count":6260,"open_issues_count":152,"forks_count":303,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-05-05T17:20:37.456Z","etag":null,"topics":["cli","elm-architecture","hacktoberfest","terminal","tui"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charmbracelet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-01-18T15:43:23.000Z","updated_at":"2025-05-05T09:40:49.000Z","dependencies_parsed_at":"2024-01-03T00:56:29.814Z","dependency_job_id":"bf8e7113-e13a-4d29-b8bc-b1dd454f895c","html_url":"https://github.com/charmbracelet/bubbles","commit_stats":{"total_commits":472,"total_committers":73,"mean_commits":6.465753424657534,"dds":0.5084745762711864,"last_synced_commit":"0b15a9fad1b094dab1bec5924eb204f2ef10551c"},"previous_names":["charmbracelet/teaparty"],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charmbracelet%2Fbubbles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charmbracelet%2Fbubbles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charmbracelet%2Fbubbles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charmbracelet%2Fbubbles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charmbracelet","download_url":"https://codeload.github.com/charmbracelet/bubbles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253831654,"owners_count":21971128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","elm-architecture","hacktoberfest","terminal","tui"],"created_at":"2024-07-30T20:01:03.338Z","updated_at":"2025-05-12T22:23:52.014Z","avatar_url":"https://github.com/charmbracelet.png","language":"Go","readme":"# Bubbles\n\n\u003cp\u003e\n  \u003cimg src=\"https://stuff.charm.sh/bubbles/bubbles-github.png\" width=\"233\" alt=\"The Bubbles Logo\"\u003e\n\u003c/p\u003e\n\n[![Latest Release](https://img.shields.io/github/release/charmbracelet/bubbles.svg)](https://github.com/charmbracelet/bubbles/releases)\n[![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](https://pkg.go.dev/github.com/charmbracelet/bubbles)\n[![Build Status](https://github.com/charmbracelet/bubbles/workflows/build/badge.svg)](https://github.com/charmbracelet/bubbles/actions)\n[![Go ReportCard](https://goreportcard.com/badge/charmbracelet/bubbles)](https://goreportcard.com/report/charmbracelet/bubbles)\n\nSome components for [Bubble Tea](https://github.com/charmbracelet/bubbletea)\napplications. These components are used in production in [Glow][glow], and [many other applications][otherstuff].\n\n[glow]: https://github.com/charmbracelet/glow\n[otherstuff]: https://github.com/charmbracelet/bubbletea/#bubble-tea-in-the-wild\n\n## Spinner\n\n\u003cimg src=\"https://stuff.charm.sh/bubbles-examples/spinner.gif\" width=\"400\" alt=\"Spinner Example\"\u003e\n\nA spinner, useful for indicating that some kind an operation is happening.\nThere are a couple default ones, but you can also pass your own ”frames.”\n\n- [Example code, basic spinner](https://github.com/charmbracelet/bubbletea/blob/main/examples/spinner/main.go)\n- [Example code, various spinners](https://github.com/charmbracelet/bubbletea/blob/main/examples/spinners/main.go)\n\n## Text Input\n\n\u003cimg src=\"https://stuff.charm.sh/bubbles-examples/textinput.gif\" width=\"400\" alt=\"Text Input Example\"\u003e\n\nA text input field, akin to an `\u003cinput type=\"text\"\u003e` in HTML. Supports unicode,\npasting, in-place scrolling when the value exceeds the width of the element and\nthe common, and many customization options.\n\n- [Example code, one field](https://github.com/charmbracelet/bubbletea/blob/main/examples/textinput/main.go)\n- [Example code, many fields](https://github.com/charmbracelet/bubbletea/blob/main/examples/textinputs/main.go)\n\n## Text Area\n\n\u003cimg src=\"https://stuff.charm.sh/bubbles-examples/textarea.gif\" width=\"400\" alt=\"Text Area Example\"\u003e\n\nA text area field, akin to an `\u003ctextarea /\u003e` in HTML. Allows for input that\nspans multiple lines. Supports unicode, pasting, vertical scrolling when the\nvalue exceeds the width and height of the element, and many customization\noptions.\n\n- [Example code, chat input](https://github.com/charmbracelet/bubbletea/blob/main/examples/chat/main.go)\n- [Example code, story time input](https://github.com/charmbracelet/bubbletea/blob/main/examples/textarea/main.go)\n\n## Table\n\n\u003cimg src=\"https://stuff.charm.sh/bubbles-examples/table.gif\" width=\"400\" alt=\"Table Example\"\u003e\n\nA component for displaying and navigating tabular data (columns and rows).\nSupports vertical scrolling and many customization options.\n\n- [Example code, countries and populations](https://github.com/charmbracelet/bubbletea/blob/main/examples/table/main.go)\n\n## Progress\n\n\u003cimg src=\"https://stuff.charm.sh/bubbles-examples/progress.gif\" width=\"800\" alt=\"Progressbar Example\"\u003e\n\nA simple, customizable progress meter, with optional animation via\n[Harmonica][harmonica]. Supports solid and gradient fills. The empty and filled\nrunes can be set to whatever you'd like. The percentage readout is customizable\nand can also be omitted entirely.\n\n- [Animated example](https://github.com/charmbracelet/bubbletea/blob/main/examples/progress-animated/main.go)\n- [Static example](https://github.com/charmbracelet/bubbletea/blob/main/examples/progress-static/main.go)\n\n[harmonica]: https://github.com/charmbracelet/harmonica\n\n## Paginator\n\n\u003cimg src=\"https://stuff.charm.sh/bubbles-examples/pagination.gif\" width=\"200\" alt=\"Paginator Example\"\u003e\n\nA component for handling pagination logic and optionally drawing pagination UI.\nSupports \"dot-style\" pagination (similar to what you might see on iOS) and\nnumeric page numbering, but you could also just use this component for the\nlogic and visualize pagination however you like.\n\n- [Example code](https://github.com/charmbracelet/bubbletea/blob/main/examples/paginator/main.go)\n\n## Viewport\n\n\u003cimg src=\"https://stuff.charm.sh/bubbles-examples/viewport.gif\" width=\"600\" alt=\"Viewport Example\"\u003e\n\nA viewport for vertically scrolling content. Optionally includes standard\npager keybindings and mouse wheel support. A high performance mode is available\nfor applications which make use of the alternate screen buffer.\n\n- [Example code](https://github.com/charmbracelet/bubbletea/blob/main/examples/pager/main.go)\n\nThis component is well complemented with [Reflow][reflow] for ANSI-aware\nindenting and text wrapping.\n\n[reflow]: https://github.com/muesli/reflow\n\n## List\n\n\u003cimg src=\"https://stuff.charm.sh/bubbles-examples/list.gif\" width=\"600\" alt=\"List Example\"\u003e\n\nA customizable, batteries-included component for browsing a set of items.\nFeatures pagination, fuzzy filtering, auto-generated help, an activity spinner,\nand status messages, all of which can be enabled and disabled as needed.\nExtrapolated from [Glow][glow].\n\n- [Example code, default list](https://github.com/charmbracelet/bubbletea/blob/main/examples/list-default/main.go)\n- [Example code, simple list](https://github.com/charmbracelet/bubbletea/blob/main/examples/list-simple/main.go)\n- [Example code, all features](https://github.com/charmbracelet/bubbletea/blob/main/examples/list-fancy/main.go)\n\n## File Picker\n\n\u003cimg src=\"https://vhs.charm.sh/vhs-yET2HNiJNEbyqaVfYuLnY.gif\" width=\"600\" alt=\"File picker example\"\u003e\n\nA customizable component for picking a file from the file system. Navigate\nthrough directories and select files, optionally limit to certain file\nextensions.\n\n- [Example code](https://github.com/charmbracelet/bubbletea/blob/main/examples/file-picker/main.go)\n\n## Timer\n\nA simple, flexible component for counting down. The update frequency and output\ncan be customized as you like.\n\n\u003cimg src=\"https://stuff.charm.sh/bubbles-examples/timer.gif\" width=\"400\" alt=\"Timer example\"\u003e\n\n- [Example code](https://github.com/charmbracelet/bubbletea/blob/main/examples/timer/main.go)\n\n## Stopwatch\n\n\u003cimg src=\"https://stuff.charm.sh/bubbles-examples/stopwatch.gif\" width=\"400\" alt=\"Stopwatch example\"\u003e\n\nA simple, flexible component for counting up. The update frequency and output\ncan be customized as you see fit.\n\n- [Example code](https://github.com/charmbracelet/bubbletea/blob/main/examples/stopwatch/main.go)\n\n## Help\n\n\u003cimg src=\"https://stuff.charm.sh/bubbles-examples/help.gif\" width=\"500\" alt=\"Help Example\"\u003e\n\nA customizable horizontal mini help view that automatically generates itself\nfrom your keybindings. It features single and multi-line modes, which the user\ncan optionally toggle between. It will truncate gracefully if the terminal is\ntoo wide for the content.\n\n- [Example code](https://github.com/charmbracelet/bubbletea/blob/main/examples/help/main.go)\n\n## Key\n\nA non-visual component for managing keybindings. It’s useful for allowing users\nto remap keybindings as well as generating help views corresponding to your\nkeybindings.\n\n```go\ntype KeyMap struct {\n    Up key.Binding\n    Down key.Binding\n}\n\nvar DefaultKeyMap = KeyMap{\n    Up: key.NewBinding(\n        key.WithKeys(\"k\", \"up\"),        // actual keybindings\n        key.WithHelp(\"↑/k\", \"move up\"), // corresponding help text\n    ),\n    Down: key.NewBinding(\n        key.WithKeys(\"j\", \"down\"),\n        key.WithHelp(\"↓/j\", \"move down\"),\n    ),\n}\n\nfunc (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n    switch msg := msg.(type) {\n    case tea.KeyMsg:\n        switch {\n        case key.Matches(msg, DefaultKeyMap.Up):\n            // The user pressed up\n        case key.Matches(msg, DefaultKeyMap.Down):\n            // The user pressed down\n        }\n    }\n    return m, nil\n}\n```\n\n## There’s more where that came from\n\nTo check out community-maintained Bubbles see [Charm \u0026\nFriends](https://github.com/charm-and-friends/additional-bubbles). Made a cool Bubble\nthat you want to share?\n[PRs](https://github.com/charm-and-friends/additional-bubbles?tab=readme-ov-file#what-is-a-complete-project)\nare welcome!\n\n## Contributing\n\nSee [contributing][contribute].\n\n[contribute]: https://github.com/charmbracelet/bubbles/contribute\n\n## Feedback\n\nWe’d love to hear your thoughts on this project. Feel free to drop us a note!\n\n- [Twitter](https://twitter.com/charmcli)\n- [The Fediverse](https://mastodon.social/@charmcli)\n- [Discord](https://charm.sh/chat)\n\n## License\n\n[MIT](https://github.com/charmbracelet/bubbletea/raw/main/LICENSE)\n\n---\n\nPart of [Charm](https://charm.sh).\n\n\u003ca href=\"https://charm.sh/\"\u003e\u003cimg alt=\"The Charm logo\" src=\"https://stuff.charm.sh/charm-badge.jpg\" width=\"400\"\u003e\u003c/a\u003e\n\nCharm热爱开源 • Charm loves open source\n","funding_links":[],"categories":["Command Line","开源类库","Go","Open source library","语言资源库","命令行","cli","Build Automation","Table of Contents"],"sub_categories":["Advanced Console UIs","命令行","Command Line","go","高级控制台用户界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharmbracelet%2Fbubbles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharmbracelet%2Fbubbles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharmbracelet%2Fbubbles/lists"}