Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/charmbracelet/bubbletea
/ functions
Functions
659 in github.com/charmbracelet/bubbletea
⨍
Functions
659
◇
Types & classes
203
↓ 59 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:991
↓ 54 callers
Method
String
()
examples/send-msg/main.go:31
↓ 43 callers
Method
Render
(w io.Writer, m list.Model, index int, listItem list.Item)
examples/list-simple/main.go:47
↓ 39 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:1372
↓ 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
Run
()
exec.go:61
↓ 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
↓ 24 callers
Function
NewProgram
NewProgram creates a new [Program].
tea.go:595
↓ 24 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:1183
↓ 24 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:40
↓ 24 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
↓ 23 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:1386
↓ 19 callers
Method
Height
()
examples/list-simple/main.go:44
↓ 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:279
↓ 9 callers
Method
Error
()
examples/http/main.go:25
↓ 9 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
↓ 9 callers
Method
String
()
examples/cellbuffer/main.go:118
↓ 8 callers
Method
IsDark
IsDark returns whether the color is dark.
color.go:89
↓ 8 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
↓ 7 callers
Method
Cursor
()
examples/autocomplete/main.go:122
↓ 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
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
↓ 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
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:1197
↓ 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:1209
↓ 4 callers
Method
Write
(p []byte)
examples/progress-download/main.go:34
↓ 3 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:1204
↓ 3 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
↓ 3 callers
Method
Title
()
examples/list-fancy/main.go:40
↓ 3 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:58
↓ 3 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:163
↓ 3 callers
Method
checkResize
checkResize detects the current size of the output and informs the program via a WindowSizeMsg.
tty.go:109
↓ 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:645
↓ 3 callers
Function
encodeCursorStyle
encodeCursorStyle returns the integer value for the given cursor style and blink state.
renderer.go:96
↓ 3 callers
Method
flush
flush flushes the output buffer to the program output.
tea.go:1221
↓ 3 callers
Function
min
(a, b int)
examples/capability/main.go:71
↓ 3 callers
Method
releaseTerminal
(reset bool)
tea.go:1323
↓ 3 callers
Function
reset
(s *cursedRenderer)
cursed_renderer.go:593
↓ 3 callers
Method
shutdown
shutdown performs operations to free up resources and restore the terminal to its original state.
tea.go:1241
↓ 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:97
↓ 3 callers
Method
windowView
()
examples/clickable/main.go:307
↓ 2 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:
commands.go:15
↓ 2 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
↓ 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
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
Function
Quit
Quit is a special command that tells the Bubble Tea program to exit.
tea.go:555
↓ 2 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:1344
↓ 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:30
↓ 2 callers
Method
String
String returns the hex representation of the color.
color.go:84
↓ 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:153
↓ 2 callers
Function
WithoutSignals
WithoutSignals will ignore OS signals. This is mainly useful for testing.
options.go:84
↓ 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
Function
downloadAndInstall
(pkg string)
examples/package-manager/main.go:117
↓ 2 callers
Function
enableTextCursor
enableTextCursor sets the text cursor mode.
cursed_renderer.go:674
↓ 2 callers
Method
execBatchMsg
(msg BatchMsg)
tea.go:918
↓ 2 callers
Method
execSequenceMsg
(msg sequenceMsg)
tea.go:892
↓ 2 callers
Method
execute
execute writes the given sequence to the program output.
tea.go:1214
↓ 2 callers
Method
flush
flush flushes the renderer's buffer to the output.
renderer.go:29
↓ 2 callers
Method
footerView
()
examples/pager/main.go:112
↓ 2 callers
Function
frame
()
examples/views/main.go:62
↓ 2 callers
Method
headerView
()
examples/autocomplete/main.go:181
↓ 2 callers
Method
headerView
()
examples/pager/main.go:106
↓ 2 callers
Method
initInputReader
initInputReader (re)commences reading inputs.
tty.go:56
↓ 2 callers
Method
initTerminal
()
tty.go:24
↓ 2 callers
Method
inputViews
()
examples/split-editors/main.go:188
↓ 2 callers
Function
keyboardEnhancementsFlags
(ke KeyboardEnhancements)
cursed_renderer.go:845
↓ 2 callers
Function
newStyles
(darkBG bool)
examples/list-fancy/main.go:20
↓ 2 callers
Function
newTextarea
()
examples/split-editors/main.go:49
↓ 2 callers
Method
next
()
examples/list-fancy/randomitems.go:140
↓ 2 callers
Method
recoverFromGoPanic
recoverFromGoPanic recovers from a goroutine panic, prints a stack trace and signals for the program to be killed and terminal restored to a usable st
tea.go:1294
↓ 2 callers
Method
recoverFromPanic
recoverFromPanic recovers from a panic, prints the stack trace, and restores the terminal to a usable state.
tea.go:1269
↓ 2 callers
Method
render
render renders the given view to the renderer.
tea.go:886
↓ 2 callers
Method
resetSpinner
()
examples/spinners/main.go:82
↓ 2 callers
Method
resize
resize notify the renderer of a terminal resize.
renderer.go:44
↓ 2 callers
Method
restoreTerminalState
restoreTerminalState restores the terminal to the state prior to running the Bubble Tea program.
tty.go:33
↓ 2 callers
Method
setColorProfile
setColorProfile sets the color profile.
renderer.go:47
↓ 2 callers
Function
setProgressBar
(s *cursedRenderer, pb *ProgressBar)
cursed_renderer.go:779
↓ 2 callers
Method
startRenderer
startRenderer starts the renderer.
tea.go:1393
↓ 2 callers
Method
stopRenderer
stopRenderer stops the renderer. If kill is true, the renderer will be stopped immediately without flushing the last frame.
tea.go:1427
↓ 2 callers
Function
tick
()
examples/fullscreen/main.go:54
↓ 2 callers
Function
tickCmd
()
examples/progress-animated/main.go:89
↓ 2 callers
Function
tickCmd
()
examples/progress-static/main.go:93
↓ 2 callers
Function
tickCmd
()
examples/eyes/main.go:79
↓ 2 callers
Function
tickCmd
()
examples/space/main.go:35
↓ 2 callers
Method
updateEyePositions
()
examples/eyes/main.go:67
↓ 2 callers
Method
updateKeybindings
()
examples/split-editors/main.go:183
↓ 2 callers
Method
updateStyles
(isDark bool)
examples/paginator/main.go:56
↓ 2 callers
Method
updateStyles
(isDark bool)
examples/keyboard-enhancements/main.go:85
↓ 2 callers
Function
waitForActivity
A command that waits for the activity on a channel.
examples/realtime/main.go:34
↓ 2 callers
Method
wipe
()
examples/cellbuffer/main.go:96
↓ 1 callers
Method
Cursor
()
examples/split-editors/main.go:210
next →
1–100 of 659, ranked by callers