Documentation
¶
Index ¶
- func RenderBadge(count int32, style lipgloss.Style) string
- func RenderOnlineDot(online bool, style lipgloss.Style) string
- func RenderQRCode(content string, size int) string
- type List
- func (l *List) ItemAtRow(row int) int
- func (l *List) ScrollBy(n int)
- func (l *List) SelectIndex(i int) bool
- func (l *List) SelectedID() string
- func (l *List) SelectedItem() *ListItem
- func (l *List) SetItems(items []ListItem)
- func (l *List) Update(msg tea.Msg) (selected bool)
- func (l *List) View() string
- type ListItem
- type ProgressBar
- type Spinner
- type SpinnerTickMsg
- type Tabs
- type TextArea
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderBadge ¶
RenderBadge renders an unread count badge.
func RenderOnlineDot ¶
RenderOnlineDot renders a small online status indicator.
func RenderQRCode ¶
RenderQRCode generates an ASCII QR code using Unicode block characters. Uses U+2580 (upper half block) and U+2584 (lower half block) to pack two rows of QR modules into one terminal row.
Types ¶
type List ¶
type List struct {
Items []ListItem
Cursor int
Offset int
Width int
Height int
Focused bool
StyleNormal lipgloss.Style
StyleActive lipgloss.Style
StyleTitle lipgloss.Style
StyleSub lipgloss.Style
StyleMeta lipgloss.Style
StyleBadge lipgloss.Style
StyleOnline lipgloss.Style
// contains filtered or unexported fields
}
List is a generic scrollable list widget with vim-style navigation.
func (*List) ItemAtRow ¶
ItemAtRow returns the index of the item displayed at the given local row (0-based, relative to the top of the list's visible area), or -1.
func (*List) SelectIndex ¶
SelectIndex moves the cursor to the given item index. Returns false if the index is out of bounds.
func (*List) SelectedID ¶
SelectedID returns the ID of the currently selected item.
func (*List) SelectedItem ¶
SelectedItem returns the currently selected item, or nil.
type ListItem ¶
type ListItem struct {
ID string
Title string
Subtitle string
Badge string
Meta string
Online bool
Avatar string // 2-line rendered avatar (half-block image or initials)
}
ListItem represents a single item in a scrollable list.
type ProgressBar ¶
type ProgressBar struct {
Progress float64 // 0.0 to 1.0
Width int
Label string
StyleBar lipgloss.Style
StyleFill lipgloss.Style
}
ProgressBar renders a download/upload progress bar.
func NewProgressBar ¶
func NewProgressBar(width int) ProgressBar
NewProgressBar creates a new progress bar.
type Spinner ¶
Spinner is a loading spinner widget.
type Tabs ¶
type Tabs struct {
Labels []string
Active int
Width int
StyleTab lipgloss.Style
StyleTabActive lipgloss.Style
}
Tabs is a tab bar widget for switching between views.