Versions in this module Expand all Collapse all v0 v0.1.0 Apr 6, 2026 Changes in this version + func DefaultCellRenderer(ds TableDataSource, row, col int, selected bool, width int, styles TableStyles) string + func LayoutHorizontal(children []Component, x, y, availW, availH, spacing int) + func LayoutTCB(top, center, bottom Component, x, y, availW, availH int) + func LayoutVertical(children []Component, x, y, availW, availH int) + func PrepareCell(ds TableDataSource, row, col, width int) string + type Alignment int + const AlignCenter + const AlignLeft + const AlignRight + type BaseComponent struct + func NewBaseComponent(id string) *BaseComponent + func (bc *BaseComponent) Active() bool + func (bc *BaseComponent) Alignment() Alignment + func (bc *BaseComponent) Enabled() bool + func (bc *BaseComponent) Focusable() bool + func (bc *BaseComponent) Focused() bool + func (bc *BaseComponent) HandleEvent(event Event) (tea.Cmd, bool) + func (bc *BaseComponent) ID() string + func (bc *BaseComponent) KeyBindings() []key.Binding + func (bc *BaseComponent) Parent() Container + func (bc *BaseComponent) Position() (int, int) + func (bc *BaseComponent) PreferredHeight() int + func (bc *BaseComponent) PreferredWidth() int + func (bc *BaseComponent) RegisterKeyBinding(keys, description string, action func() tea.Cmd) + func (bc *BaseComponent) RemoveKeyBinding(binding key.Binding) + func (bc *BaseComponent) RenderInSize(content string) string + func (bc *BaseComponent) ResolveKeyBinding(msg tea.KeyMsg) (func() tea.Cmd, bool) + func (bc *BaseComponent) SetAlignment(a Alignment) + func (bc *BaseComponent) SetEnabled(v bool) + func (bc *BaseComponent) SetFocused(v bool) tea.Cmd + func (bc *BaseComponent) SetParent(p Container) + func (bc *BaseComponent) SetPosition(x, y int) + func (bc *BaseComponent) SetPreferredHeight(h int) + func (bc *BaseComponent) SetPreferredWidth(w int) + func (bc *BaseComponent) SetSize(w, h int) + func (bc *BaseComponent) SetVisible(v bool) + func (bc *BaseComponent) Size() (int, int) + func (bc *BaseComponent) View() string + func (bc *BaseComponent) Visible() bool + type BaseContainer struct + func NewBaseContainer(id string, self Container) *BaseContainer + func (bc *BaseContainer) AddChild(child Component) + func (bc *BaseContainer) Children() []Component + func (bc *BaseContainer) Focusable() bool + func (bc *BaseContainer) InnerFocused() bool + func (bc *BaseContainer) View() string + type BorderConfig struct + ActiveColor lipgloss.Color + Color lipgloss.Color + Padding int + Type BorderType + func DefaultBorder() BorderConfig + func SingleLineBorder(color, activeColor string) BorderConfig + func (bc BorderConfig) ChromeHeight() int + func (bc BorderConfig) ChromeWidth() int + func (bc BorderConfig) HasBorder() bool + func (bc BorderConfig) Style(focused bool) lipgloss.Style + type BorderType int + const NoBorder + const RoundedBorder + type Button struct + func NewButton(id, label string, styles ButtonStyles) *Button + func (b *Button) BindDefaultActionToKey(keys string, description ...string) + func (b *Button) HandleEvent(event Event) (tea.Cmd, bool) + func (b *Button) OnPress(fn func() tea.Cmd) + func (b *Button) Update(msg tea.KeyMsg) (tea.Cmd, bool) + func (b *Button) View() string + type ButtonStyles struct + Focused lipgloss.Style + Normal lipgloss.Style + func DefaultButtonStyles() ButtonStyles + func DefaultPopupButtonStyles() ButtonStyles + type Card struct + func NewCard(id, title, value string, styles CardStyles) *Card + func (c *Card) SetAlert(alert bool) + func (c *Card) SetValue(value string) + func (c *Card) Value() string + func (c *Card) View() string + type CardStyles struct + Alert lipgloss.Style + Border lipgloss.Style + Title lipgloss.Style + Value lipgloss.Style + func DefaultCardStyles() CardStyles + type CellRenderer func(ds TableDataSource, row, col int, selected bool, width int, styles TableStyles) string + type CheckboxItem struct + Checked bool + IsGroup bool + Label string + Value string + type CheckboxList struct + func NewCheckboxList(id string, items []CheckboxItem, styles CheckboxListStyles) *CheckboxList + func (cl *CheckboxList) BindDefaultActionToKey(keys string, description ...string) + func (cl *CheckboxList) Cursor() int + func (cl *CheckboxList) HandleEvent(event Event) (tea.Cmd, bool) + func (cl *CheckboxList) Items() []CheckboxItem + func (cl *CheckboxList) OnChange(fn func([]CheckboxItem) tea.Cmd) + func (cl *CheckboxList) Selected() []string + func (cl *CheckboxList) Update(msg tea.KeyMsg) (tea.Cmd, bool) + func (cl *CheckboxList) View() string + type CheckboxListStyles struct + Checked lipgloss.Style + Cursor lipgloss.Style + Dim lipgloss.Style + Group lipgloss.Style + Item lipgloss.Style + Unchecked lipgloss.Style + func DefaultCheckboxListStyles() CheckboxListStyles + type ColumnDef struct + Renderer CellRenderer + Title string + Width int + type Component interface + Active func() bool + Enabled func() bool + Focusable func() bool + Focused func() bool + HandleEvent func(event Event) (tea.Cmd, bool) + ID func() string + KeyBindings func() []key.Binding + Parent func() Container + Position func() (x, y int) + PreferredHeight func() int + PreferredWidth func() int + RegisterKeyBinding func(keys, description string, action func() tea.Cmd) + ResolveKeyBinding func(tea.KeyMsg) (func() tea.Cmd, bool) + SetEnabled func(bool) + SetFocused func(bool) tea.Cmd + SetParent func(Container) + SetPosition func(x, y int) + SetPreferredHeight func(int) + SetPreferredWidth func(int) + SetSize func(w, h int) + SetVisible func(bool) + Size func() (w, h int) + View func() string + Visible func() bool + type Container interface + AddChild func(child Component) + Children func() []Component + InnerFocused func() bool + type Event interface + type Field struct + func NewField(id, labelText string, input Component, styles FieldStyles) *Field + func (f *Field) Input() Component + func (f *Field) Label() *Text + func (f *Field) Separator() *Text + func (f *Field) View() string + type FieldStyles struct + Label lipgloss.Style + LabelHot lipgloss.Style + Separator lipgloss.Style + func DefaultFieldStyles() FieldStyles + type FocusableComponent struct + func NewFocusableComponent(id string) FocusableComponent + func (fc *FocusableComponent) Focusable() bool + func (fc *FocusableComponent) OnKeyPress(fn func(tea.KeyMsg) tea.Cmd) + type FormattedTextInput struct + func NewFormattedTextInput(id string, inputWidth int) *FormattedTextInput + func (fti *FormattedTextInput) SetFocused(focused bool) tea.Cmd + func (fti *FormattedTextInput) WithFormat(fn func(string) string) + func (fti *FormattedTextInput) WithValidation(fn func(string) error) + type Layout int + const Horizontal + const TCB + const Vertical + type Leaf interface + Update func(msg tea.KeyMsg) (tea.Cmd, bool) + type MouseClickEvent struct + Button tea.MouseButton + X int + Y int + type MouseScrollEvent struct + Direction int + X int + Y int + type Panel struct + func NewPanel(id string, layout ...Layout) *Panel + func (p *Panel) Add(child Component, position Position) + func (p *Panel) SetBorder(config BorderConfig) + func (p *Panel) SetSpacing(spacing int) + func (p *Panel) SetTitle(title string) + func (p *Panel) SetTitleStyle(style lipgloss.Style) + func (p *Panel) View() string + type Position int + const Next + const TCBBottom + const TCBCenter + const TCBTop + type ScrollableText struct + func NewScrollableText(id string, styles ScrollableTextStyles) *ScrollableText + func (st *ScrollableText) Content() string + func (st *ScrollableText) HandleEvent(event Event) (tea.Cmd, bool) + func (st *ScrollableText) ScrollTo(line int) + func (st *ScrollableText) ScrollTop() + func (st *ScrollableText) SetContent(text string) + func (st *ScrollableText) SetWrap(wrap bool) + func (st *ScrollableText) Update(msg tea.KeyMsg) (tea.Cmd, bool) + func (st *ScrollableText) View() string + type ScrollableTextStyles struct + Focused lipgloss.Style + Normal lipgloss.Style + func DefaultScrollableTextStyles() ScrollableTextStyles + type SliceDataSource struct + func NewSliceDataSource(data [][]string) *SliceDataSource + func (s *SliceDataSource) CellData(row, col int) string + func (s *SliceDataSource) RowCount() int + func (s *SliceDataSource) SetData(data [][]string) + type TabBar struct + func NewTabBar(id string, labels []string, styles TabBarStyles) *TabBar + func (tb *TabBar) ActiveTab() int + func (tb *TabBar) BindDefaultActionToKey(keys string, description ...string) + func (tb *TabBar) CursorTab() int + func (tb *TabBar) HandleEvent(event Event) (tea.Cmd, bool) + func (tb *TabBar) OnChange(fn func(int) tea.Cmd) + func (tb *TabBar) SetActiveTab(i int) + func (tb *TabBar) SetFocused(v bool) tea.Cmd + func (tb *TabBar) SetTabKeyBinding(index int, keys string, description ...string) + func (tb *TabBar) Update(msg tea.KeyMsg) (tea.Cmd, bool) + func (tb *TabBar) View() string + type TabBarStyles struct + Active lipgloss.Style + Focused lipgloss.Style + Inactive lipgloss.Style + func DefaultTabBarStyles() TabBarStyles + type TabComponent struct + func NewTabComponent(id string, styles TabBarStyles) *TabComponent + func (tc *TabComponent) ActiveTab() int + func (tc *TabComponent) AddTab(label string, content Component) + func (tc *TabComponent) OnChange(fn func(int) tea.Cmd) + func (tc *TabComponent) SetActiveTab(index int) + func (tc *TabComponent) SetTabKeyBinding(index int, keys string, description ...string) + func (tc *TabComponent) TabBar() *TabBar + func (tc *TabComponent) View() string + type Table struct + func NewTable(id string, columns []ColumnDef, ds TableDataSource, styles TableStyles) *Table + func (t *Table) Cursor() int + func (t *Table) DataSource() TableDataSource + func (t *Table) HandleEvent(event Event) (tea.Cmd, bool) + func (t *Table) OnRowClick(fn func(row int) tea.Cmd) + func (t *Table) OnRowKeyPress(fn func(row int, msg tea.KeyMsg) tea.Cmd) + func (t *Table) SetColumnSpacing(spacing int) + func (t *Table) SetCursor(c int) + func (t *Table) SetDataSource(ds TableDataSource) + func (t *Table) Update(msg tea.KeyMsg) (tea.Cmd, bool) + func (t *Table) View() string + type TableDataSource interface + CellData func(row, col int) string + RowCount func() int + type TableStyles struct + Cell lipgloss.Style + Header lipgloss.Style + Selected lipgloss.Style + func DefaultTableStyles() TableStyles + type Text struct + func NewText(id, text string, style lipgloss.Style) *Text + func (t *Text) GetText() string + func (t *Text) SetStyle(s lipgloss.Style) + func (t *Text) SetText(text string) + func (t *Text) Style() lipgloss.Style + func (t *Text) View() string + type TextInput struct + func NewTextInput(id string, inputWidth int) *TextInput + func (t *TextInput) Error() string + func (t *TextInput) HandleEvent(event Event) (tea.Cmd, bool) + func (t *TextInput) OnChange(fn func(string) tea.Cmd) + func (t *TextInput) OnSubmit(fn func(string) tea.Cmd) + func (t *TextInput) SetError(e string) + func (t *TextInput) SetFocused(v bool) tea.Cmd + func (t *TextInput) SetSize(w, h int) + func (t *TextInput) SetValue(v string) + func (t *TextInput) Update(msg tea.KeyMsg) (tea.Cmd, bool) + func (t *TextInput) Value() string + func (t *TextInput) View() string + func (t *TextInput) WithCharLimit(n int) *TextInput + func (t *TextInput) WithPlaceholder(p string) *TextInput + type Toggle struct + func NewToggle(id, label string, initial bool, mode ToggleMode, styles ToggleStyles) *Toggle + func (t *Toggle) BindDefaultActionToKey(keys string, description ...string) + func (t *Toggle) HandleEvent(event Event) (tea.Cmd, bool) + func (t *Toggle) On() bool + func (t *Toggle) OnChange(fn func(bool) tea.Cmd) + func (t *Toggle) SetLabels(onLabel, offLabel string) + func (t *Toggle) SetOn(v bool) + func (t *Toggle) Update(msg tea.KeyMsg) (tea.Cmd, bool) + func (t *Toggle) View() string + type ToggleMode int + const ToggleModeOnOff + const ToggleModeRadio + type ToggleStyles struct + Label lipgloss.Style + OffActive lipgloss.Style + OffFocused lipgloss.Style + OffInactive lipgloss.Style + OnActive lipgloss.Style + OnFocused lipgloss.Style + func DefaultToggleStyles() ToggleStyles