Role-aware speech bubble with width-aware wrapping.
glyph add chat-bubbleThis copies chat-bubble.go (and its test file) into your repo at the path your
glyph.json aliases declare. After install, the file is yours: edit it,
refactor it, rename it. There is no chat-bubble library to keep in sync.
package main
import (
"fmt"
chatbubble "github.com/truffle-dev/glyph/components/chat-bubble"
"github.com/truffle-dev/glyph/components/theme"
)
func main() {
b := chatbubble.New(theme.Default).
WithRole(chatbubble.RoleAssistant).
WithLabel("glyph").
WithText("Welcome.").
WithWidth(72)
fmt.Println(b.View())
}Package: chatbubble
Types
RoleBubble
Functions and methods
NewWithRoleWithTextWithWidthWithLabelView
- glyph component
theme(installed automatically) github.com/charmbracelet/lipgloss@v1.1.0github.com/muesli/reflow@v0.3.0
Pair with chat-input and chat-thread for a full chat surface. Roles: user, assistant, system, tool.
- examples/showcase — single-binary TUI composing the seven main surfaces
- components/chat-bubble/story — runnable story binary (
go run -tags glyph_story ./components/chat-bubble/story/) - registry manifest — the JSON contract
glyph addreads
MIT, same as the rest of glyph.
