ui

package
v1.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package ui provides reusable UI components for the go-mink CLI. It includes spinners, progress bars, tables, and other interactive elements.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Banner() string

Banner renders the mink ASCII art banner

func Confirmation

func Confirmation(confirmed bool) string

Confirmation returns a yes/no prompt result display

func Divider

func Divider(width int) string

Divider returns a horizontal divider line

func ListItems

func ListItems(items []string) string

ListItems formats a list of items with bullets

func NumberedList

func NumberedList(items []string) string

NumberedList formats a numbered list

func SimpleBanner

func SimpleBanner() string

SimpleBanner returns a smaller, simpler banner

func StatusBadge

func StatusBadge(status string) string

StatusBadge returns a styled status badge

Types

type AnimatedBannerModel

type AnimatedBannerModel struct {
	// contains filtered or unexported fields
}

AnimatedBanner creates an animated banner effect

func NewAnimatedBanner

func NewAnimatedBanner() AnimatedBannerModel

func (AnimatedBannerModel) Init

func (m AnimatedBannerModel) Init() tea.Cmd

func (AnimatedBannerModel) Update

func (m AnimatedBannerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (AnimatedBannerModel) View

func (m AnimatedBannerModel) View() string

type AnimationTickMsg

type AnimationTickMsg struct{}

type ProgressModel

type ProgressModel struct {
	// contains filtered or unexported fields
}

ProgressModel is a progress bar component

func NewProgress

func NewProgress(message string) ProgressModel

NewProgress creates a new progress bar

func (ProgressModel) Init

func (m ProgressModel) Init() tea.Cmd

func (ProgressModel) Update

func (m ProgressModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ProgressModel) View

func (m ProgressModel) View() string

type ProgressMsg

type ProgressMsg struct {
	Percent float64
	Message string
}

ProgressMsg updates the progress bar

type SpinnerDoneMsg

type SpinnerDoneMsg struct {
	Result string
	Err    error
}

SpinnerDoneMsg signals that the spinner operation is complete

type SpinnerModel

type SpinnerModel struct {
	// contains filtered or unexported fields
}

SpinnerModel is a spinner component with a message

func NewSpinner

func NewSpinner(message string, spinnerType SpinnerType) SpinnerModel

NewSpinner creates a new spinner with the given message

func (SpinnerModel) Init

func (m SpinnerModel) Init() tea.Cmd

func (SpinnerModel) Update

func (m SpinnerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (SpinnerModel) View

func (m SpinnerModel) View() string

type SpinnerType

type SpinnerType int

SpinnerType defines different spinner animations

const (
	SpinnerDots SpinnerType = iota
	SpinnerLine
	SpinnerMinidots
	SpinnerJump
	SpinnerPulse
	SpinnerPoints
	SpinnerGlobe
	SpinnerMoon
	SpinnerMonkey
	SpinnerMeter
	SpinnerHamburger
)

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table renders a beautiful table

func NewTable

func NewTable(headers ...string) *Table

NewTable creates a new table with headers

func (*Table) AddRow

func (t *Table) AddRow(values ...string)

AddRow adds a row to the table

func (*Table) Render

func (t *Table) Render() string

Render returns the formatted table string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL