Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/charmbracelet/bubbletea
/ functions
Functions
758 in github.com/charmbracelet/bubbletea
⨍
Functions
758
◇
Types & classes
222
↓ 73 callers
Method
Run
Run initializes the program and runs its event loops, blocking until it gets terminated by either [Program.Quit], [Program.Kill], or its signal handle
tea.go:1039
↓ 55 callers
Method
String
()
examples/send-msg/main.go:31
↓ 48 callers
Method
Run
()
exec.go:61
↓ 43 callers
Method
Render
(w io.Writer, m list.Model, index int, listItem list.Item)
examples/list-simple/main.go:47
↓ 42 callers
Function
NewProgram
NewProgram creates a new [Program].
tea.go:625
↓ 40 callers
Method
Println
Println prints above the Program. This output is unmanaged by the program and will persist across renders by the Program. If the altscreen is active
tea.go:1498
↓ 40 callers
Function
WithInput
WithInput sets the input which, by default, is stdin. In most cases you won't need to use this. To disable input entirely pass nil. p := NewProgram(
options.go:47
↓ 39 callers
Function
WithOutput
WithOutput sets the output which, by default, is stdout. In most cases you won't need to use this.
options.go:30
↓ 36 callers
Method
View
View renders the program's UI, which can be a string or a [Layer]. The view is rendered after every Update.
tea.go:64
↓ 35 callers
Method
Update
Update is called when a message is received. Use it to inspect messages and, in response, update the model and/or send a command.
tea.go:60
↓ 32 callers
Method
Send
Send sends a message to the main update function, effectively allowing messages to be injected from outside the program for interoperability purposes.
tea.go:1280
↓ 26 callers
Method
String
String implements [fmt.Stringer] and is quite useful for matching key events. It will return the textual representation of the [Key] if there is one,
key.go:351
↓ 24 callers
Method
Printf
Printf prints above the Program. It takes a format template followed by values similar to fmt.Printf. This output is unmanaged by the program and will
tea.go:1513
↓ 23 callers
Function
NewView
NewView is a helper function to create a new [View] with the given styled string. A styled string represents text with styles and hyperlinks encoded a
tea.go:76
↓ 19 callers
Method
Height
()
examples/list-simple/main.go:44
↓ 15 callers
Function
newCursedRenderer
(w io.Writer, env []string, width, height int)
cursed_renderer.go:43
↓ 13 callers
Method
flush
flush flushes the renderer's buffer to the output. It reports whether there was anything to draw, so the caller can tell an idle screen from an active
renderer.go:31
↓ 13 callers
Method
render
render renders a frame to the output.
renderer.go:26
↓ 12 callers
Function
WithContext
WithContext lets you specify a context in which to run the Program. This is useful if you want to cancel the execution from outside. When a Program ge
options.go:22
↓ 11 callers
Method
Error
()
examples/http/main.go:25
↓ 11 callers
Method
Quit
Quit is a convenience function for quitting Bubble Tea programs. Use it when you need to shut down a Bubble Tea program from the outside. If you wish
tea.go:1294
↓ 11 callers
Method
SetContent
SetContent is a helper method to set the content of a [View] with a styled string. A styled string represents text with styles and hyperlinks encoded
tea.go:293
↓ 10 callers
Method
Getenv
Getenv returns the value of the environment variable named by the key. If the variable is not present in the environment, the value returned will be t
environ.go:24
↓ 10 callers
Method
Len
()
renderer_park_test.go:32
↓ 9 callers
Method
String
()
examples/cellbuffer/main.go:118
↓ 9 callers
Method
start
start starts the renderer.
renderer.go:20
↓ 8 callers
Method
IsDark
IsDark returns whether the color is dark.
color.go:93
↓ 7 callers
Method
Cursor
()
examples/autocomplete/main.go:122
↓ 7 callers
Function
WithEnvironment
WithEnvironment sets the environment variables that the program will use. This useful when the program is running in a remote session (e.g. SSH) and y
options.go:65
↓ 7 callers
Function
WithWindowSize
WithWindowSize sets the initial size of the terminal window. This is useful when you need to set the initial size of the terminal window, for example
options.go:170
↓ 6 callers
Method
Init
Init is the first function that will be called. It returns an optional initial command. To not perform an initial command return nil.
tea.go:56
↓ 6 callers
Method
Kill
Kill stops the program immediately and restores the former terminal state. The final render that you would normally see when quitting will be skipped.
tea.go:1308
↓ 6 callers
Function
WithoutRenderer
WithoutRenderer disables the renderer. When this is set output and log statements will be plainly sent to stdout (or another output if one is set) wit
options.go:105
↓ 5 callers
Method
Key
Key returns the underlying key event.
key.go:263
↓ 5 callers
Method
Mouse
Mouse returns the underlying mouse event.
mouse.go:50
↓ 5 callers
Method
Write
(p []byte)
renderer_park_test.go:26
↓ 5 callers
Function
awaitQuitLifecycle
(t *testing.T, done <-chan struct{}, operation string)
quit_lifecycle_test.go:32
↓ 5 callers
Method
close
close closes the renderer and flushes any remaining data.
renderer.go:23
↓ 5 callers
Method
setWidthMethod
setWidthMethod sets the method for calculating the width of the terminal.
renderer.go:43
↓ 4 callers
Method
String
String returns a string representation of the mouse message.
mouse.go:78
↓ 4 callers
Method
Wait
Wait waits/blocks until the underlying Program finished shutting down.
tea.go:1318
↓ 4 callers
Function
WithFPS
WithFPS sets a custom maximum FPS at which the renderer should run. If less than 1, the default value of 60 will be used. If over 120, the FPS will be
options.go:149
↓ 4 callers
Method
insertAbove
insertAbove inserts unmanaged lines above the renderer.
renderer.go:37
↓ 4 callers
Function
keyboardEnhancementsFlags
(ke KeyboardEnhancements)
cursed_renderer.go:977
↓ 4 callers
Function
min
(a, b int)
examples/capability/main.go:71
↓ 4 callers
Method
shutdown
shutdown performs operations to free up resources and restore the terminal to its original state.
tea.go:1367
↓ 3 callers
Function
Batch
Batch performs a bunch of commands concurrently with no ordering guarantees about the results. Use a Batch to return several commands. Example: fun
commands.go:15
↓ 3 callers
Function
ExecProcess
ExecProcess runs the given *exec.Cmd in a blocking fashion, effectively pausing the Program while the command is running. After the *exec.Cmd exists t
exec.go:50
↓ 3 callers
Function
Quit
Quit is a special command that tells the Bubble Tea program to exit.
tea.go:585
↓ 3 callers
Method
RestoreTerminal
RestoreTerminal reinitializes the Program's input reader, restores the terminal to the former state when the program was running, and repaints. Use it
tea.go:1469
↓ 3 callers
Method
Title
()
examples/list-fancy/main.go:40
↓ 3 callers
Function
WithoutSignals
WithoutSignals will ignore OS signals. This is mainly useful for testing.
options.go:91
↓ 3 callers
Function
assertInOrder
(t *testing.T, got string, wants ...string)
cursed_renderer_test.go:230
↓ 3 callers
Method
checkResize
checkResize detects the current size of the output and informs the program via a WindowSizeMsg.
tty.go:159
↓ 3 callers
Function
enableAltScreen
enableAltScreen sets the alt screen mode. Note that this writes to the buffer directly if write is true.
cursed_renderer.go:742
↓ 3 callers
Function
encodeCursorStyle
encodeCursorStyle returns the integer value for the given cursor style and blink state.
renderer.go:105
↓ 3 callers
Method
fallbackDimensions
fallbackDimensions returns width and height, falling back to COLUMNS/LINES environment variables or 80x24 defaults when dimensions are non-positive.
tty.go:127
↓ 3 callers
Method
flush
flush flushes the output buffer to the program output.
tea.go:1347
↓ 3 callers
Function
newParkHarness
(t *testing.T, fps int, opts ...ProgramOption)
renderer_park_test.go:100
↓ 3 callers
Method
releaseTerminal
(reset bool)
tea.go:1449
↓ 3 callers
Function
reset
(s *cursedRenderer)
cursed_renderer.go:675
↓ 3 callers
Method
resize
resize notify the renderer of a terminal resize.
renderer.go:46
↓ 3 callers
Method
restoreTerminalState
restoreTerminalState restores the terminal to the state prior to running the Bubble Tea program.
tty.go:34
↓ 3 callers
Function
tick
()
examples/views/main.go:56
↓ 3 callers
Method
waitForReadLoop
waitForReadLoop waits for the cancelReader to finish its read loop.
tty.go:110
↓ 3 callers
Method
waitParked
waitParked waits until the renderer has stopped ticking.
renderer_park_test.go:135
↓ 3 callers
Method
windowView
()
examples/clickable/main.go:307
↓ 2 callers
Function
Exec
Exec is used to perform arbitrary I/O in a blocking fashion, effectively pausing the Program while execution is running and resuming it when execution
exec.go:22
↓ 2 callers
Method
Keystroke
Keystroke returns the keystroke representation of the [Key]. While less type safe than looking at the individual fields, it will usually be more conve
key.go:369
↓ 2 callers
Function
LogToFileWith
LogToFileWith does allows to call LogToFile with a custom LogOptionsSetter.
logging.go:36
↓ 2 callers
Method
LookupEnv
LookupEnv retrieves the value of the environment variable named by the key. If the variable is present in the environment the value (which may be empt
environ.go:32
↓ 2 callers
Method
ReleaseTerminal
ReleaseTerminal restores the original terminal state and cancels the input reader. You can return control to the Program with RestoreTerminal.
tea.go:1445
↓ 2 callers
Function
Sequence
Sequence runs the given commands one at a time, in order. Contrast this with Batch, which runs commands concurrently.
commands.go:25
↓ 2 callers
Method
SetOutput
(io.Writer)
logging.go:31
↓ 2 callers
Method
String
String returns the hex representation of the color.
color.go:88
↓ 2 callers
Method
String
()
examples/set-terminal-color/main.go:22
↓ 2 callers
Method
SupportsEventTypes
SupportsEventTypes returns whether the terminal supports reporting different types of key events (press, release, and repeat).
keyboard.go:39
↓ 2 callers
Function
WithColorProfile
WithColorProfile sets the color profile that the program will use. This is useful when you want to force a specific color profile. By default, Bubble
options.go:160
↓ 2 callers
Function
WithFilter
WithFilter supplies an event filter that will be invoked before Bubble Tea processes a tea.Msg. The event filter can return any tea.Msg which will the
options.go:140
↓ 2 callers
Function
animate
()
examples/cellbuffer/main.go:131
↓ 2 callers
Method
canFindBook
canFindBook returns whether the find button is to be pressed
examples/isbn-form/main.go:42
↓ 2 callers
Method
checkOptimizedMovements
(s *term.State)
termios_bsd.go:11
↓ 2 callers
Function
clamp
(n, min, max int)
examples/clickable/main.go:361
↓ 2 callers
Method
count
count returns the number of ticks so far.
renderer_park_test.go:64
↓ 2 callers
Function
downloadAndInstall
(pkg string)
examples/package-manager/main.go:117
↓ 2 callers
Function
enableTextCursor
enableTextCursor sets the text cursor mode.
cursed_renderer.go:771
↓ 2 callers
Method
execBatchMsg
(msg BatchMsg)
tea.go:966
↓ 2 callers
Method
execSequenceMsg
(msg sequenceMsg)
tea.go:940
↓ 2 callers
Method
execute
execute writes the given sequence to the program output.
tea.go:1323
↓ 2 callers
Method
executeQuery
executeQuery writes a terminal query to the program output. Queries expect a reply on p.input, so when input is disabled the query is skipped: the pro
tea.go:1339
↓ 2 callers
Method
footerView
()
examples/pager/main.go:112
↓ 2 callers
Function
frame
()
examples/views/main.go:62
↓ 2 callers
Method
handleSignals
()
tea.go:672
↓ 2 callers
Method
headerView
()
examples/autocomplete/main.go:181
↓ 2 callers
Method
headerView
()
examples/pager/main.go:106
↓ 2 callers
Method
init
(w, h int)
examples/cellbuffer/main.go:79
↓ 2 callers
Method
initInputReader
initInputReader (re)commences reading inputs.
tty.go:57
↓ 2 callers
Method
initTerminal
()
tty.go:25
↓ 2 callers
Method
inputViews
()
examples/split-editors/main.go:188
↓ 2 callers
Function
isPlausibleWindowSize
(width, height int)
screen.go:73
next →
1–100 of 758, ranked by callers