Documentation
¶
Index ¶
- type Modal
- func (m *Modal) Blur()
- func (m *Modal) Focus()
- func (m *Modal) Focused() bool
- func (m *Modal) Hide()
- func (m *Modal) Init() tea.Cmd
- func (m *Modal) IsVisible() bool
- func (m *Modal) SetMessage(message string)
- func (m *Modal) SetTitle(title string)
- func (m *Modal) Show()
- func (m *Modal) ShowAlert(title, message string, onOK func() tea.Cmd)
- func (m *Modal) ShowConfirm(title, message string, onYes, onNo func() tea.Cmd)
- func (m *Modal) ShowInput(title, message, placeholder string, onOK func(string) tea.Cmd, ...)
- func (m *Modal) Update(msg tea.Msg) (tui.Component, tea.Cmd)
- func (m *Modal) View() string
- type ModalButton
- type ModalOption
- func WithModalButtons(buttons []ModalButton) ModalOption
- func WithModalInput(placeholder string) ModalOption
- func WithModalMessage(message string) ModalOption
- func WithModalOnCancel(fn func() tea.Cmd) ModalOption
- func WithModalOnConfirm(fn func(string) tea.Cmd) ModalOption
- func WithModalTitle(title string) ModalOption
- func WithModalType(t ModalType) ModalOption
- type ModalType
- type SplitDirection
- type SplitPane
- func (s *SplitPane) Blur()
- func (s *SplitPane) EnterResizeMode()
- func (s *SplitPane) ExitResizeMode()
- func (s *SplitPane) Focus()
- func (s *SplitPane) FocusBottom()
- func (s *SplitPane) FocusLeft()
- func (s *SplitPane) FocusRight()
- func (s *SplitPane) FocusTop()
- func (s *SplitPane) Focused() bool
- func (s *SplitPane) GetFocusedPane() int
- func (s *SplitPane) GetRatio() float64
- func (s *SplitPane) Init() tea.Cmd
- func (s *SplitPane) IsResizing() bool
- func (s *SplitPane) SetLeftComponent(c tui.Component)
- func (s *SplitPane) SetRatio(r float64)
- func (s *SplitPane) SetRightComponent(c tui.Component)
- func (s *SplitPane) ToggleFocus()
- func (s *SplitPane) Update(msg tea.Msg) (tui.Component, tea.Cmd)
- func (s *SplitPane) View() string
- type SplitPaneOption
- func WithBottomComponent(c tui.Component) SplitPaneOption
- func WithDirection(d SplitDirection) SplitPaneOption
- func WithDividerChar(ch string) SplitPaneOption
- func WithLeftComponent(c tui.Component) SplitPaneOption
- func WithMinMaxRatio(min, max float64) SplitPaneOption
- func WithRatio(r float64) SplitPaneOption
- func WithRightComponent(c tui.Component) SplitPaneOption
- func WithShowDivider(show bool) SplitPaneOption
- func WithSplitPaneDesignTokens(tokens *design.DesignTokens) SplitPaneOption
- func WithSplitPaneTheme(theme string) SplitPaneOption
- func WithTopComponent(c tui.Component) SplitPaneOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Modal ¶
type Modal struct {
// contains filtered or unexported fields
}
Modal displays overlay dialogs for user interaction
func (*Modal) SetMessage ¶
SetMessage updates the modal message
func (*Modal) ShowConfirm ¶
ShowConfirm displays a confirmation modal
func (*Modal) ShowInput ¶
func (m *Modal) ShowInput(title, message, placeholder string, onOK func(string) tea.Cmd, onCancel func() tea.Cmd)
ShowInput displays an input modal
type ModalButton ¶
type ModalButton struct {
Label string
Action func(string) tea.Cmd // Input value passed for ModalInput, empty string otherwise
}
ModalButton represents a button in the modal
type ModalOption ¶
type ModalOption func(*Modal)
ModalOption configures a Modal
func WithModalButtons ¶
func WithModalButtons(buttons []ModalButton) ModalOption
WithModalButtons sets custom buttons
func WithModalInput ¶
func WithModalInput(placeholder string) ModalOption
WithModalInput enables text input (for ModalInput type)
func WithModalMessage ¶
func WithModalMessage(message string) ModalOption
WithModalMessage sets the modal message
func WithModalOnCancel ¶
func WithModalOnCancel(fn func() tea.Cmd) ModalOption
WithModalOnCancel sets the cancel callback
func WithModalOnConfirm ¶
func WithModalOnConfirm(fn func(string) tea.Cmd) ModalOption
WithModalOnConfirm sets the confirm callback
func WithModalTitle ¶
func WithModalTitle(title string) ModalOption
WithModalTitle sets the modal title
type SplitDirection ¶
type SplitDirection int
SplitDirection controls how panes are arranged.
const ( // SplitHorizontal renders panes side-by-side (left/right). SplitHorizontal SplitDirection = iota // SplitVertical renders panes stacked (top/bottom). SplitVertical )
type SplitPane ¶
type SplitPane struct {
// contains filtered or unexported fields
}
SplitPane renders two components in a resizable split layout.
func NewSplitPane ¶
func NewSplitPane(opts ...SplitPaneOption) *SplitPane
NewSplitPane creates a split pane with defaults.
func (*SplitPane) EnterResizeMode ¶
func (s *SplitPane) EnterResizeMode()
EnterResizeMode enables resize mode.
func (*SplitPane) ExitResizeMode ¶
func (s *SplitPane) ExitResizeMode()
ExitResizeMode disables resize mode.
func (*SplitPane) FocusBottom ¶
func (s *SplitPane) FocusBottom()
FocusBottom focuses the bottom pane (alias of right in vertical mode).
func (*SplitPane) FocusTop ¶
func (s *SplitPane) FocusTop()
FocusTop focuses the top pane (alias of left in vertical mode).
func (*SplitPane) GetFocusedPane ¶
GetFocusedPane returns the focused pane index (0 or 1).
func (*SplitPane) IsResizing ¶
IsResizing reports whether resize mode is active.
func (*SplitPane) SetLeftComponent ¶
SetLeftComponent sets the left/top child component.
func (*SplitPane) SetRightComponent ¶
SetRightComponent sets the right/bottom child component.
func (*SplitPane) ToggleFocus ¶
func (s *SplitPane) ToggleFocus()
ToggleFocus switches focus between panes.
type SplitPaneOption ¶
type SplitPaneOption func(*SplitPane)
SplitPaneOption configures a SplitPane.
func WithBottomComponent ¶
func WithBottomComponent(c tui.Component) SplitPaneOption
WithBottomComponent sets the bottom pane component (alias for right in vertical mode).
func WithDirection ¶
func WithDirection(d SplitDirection) SplitPaneOption
WithDirection sets split direction.
func WithDividerChar ¶
func WithDividerChar(ch string) SplitPaneOption
WithDividerChar sets the divider character/string.
func WithLeftComponent ¶
func WithLeftComponent(c tui.Component) SplitPaneOption
WithLeftComponent sets the left pane component.
func WithMinMaxRatio ¶
func WithMinMaxRatio(min, max float64) SplitPaneOption
WithMinMaxRatio sets minimum and maximum ratio bounds.
func WithRightComponent ¶
func WithRightComponent(c tui.Component) SplitPaneOption
WithRightComponent sets the right pane component.
func WithShowDivider ¶
func WithShowDivider(show bool) SplitPaneOption
WithShowDivider toggles divider visibility.
func WithSplitPaneDesignTokens ¶
func WithSplitPaneDesignTokens(tokens *design.DesignTokens) SplitPaneOption
WithSplitPaneDesignTokens applies design-system tokens.
func WithSplitPaneTheme ¶
func WithSplitPaneTheme(theme string) SplitPaneOption
WithSplitPaneTheme applies a named theme.
func WithTopComponent ¶
func WithTopComponent(c tui.Component) SplitPaneOption
WithTopComponent sets the top pane component (alias for left in vertical mode).