ui

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package ui provides terminal widgets for git-spice.

Index

Constants

This section is empty.

Variables

View Source
var (
	Yellow  = lipgloss.AdaptiveColor{Light: "2", Dark: "11"}
	Red     = lipgloss.AdaptiveColor{Light: "1", Dark: "9"}
	Green   = lipgloss.AdaptiveColor{Light: "2", Dark: "10"}
	Plain   = lipgloss.AdaptiveColor{Light: "0", Dark: "7"}
	Cyan    = lipgloss.AdaptiveColor{Light: "6", Dark: "14"}
	Magenta = lipgloss.AdaptiveColor{Light: "5", Dark: "13"}
	Gray    = lipgloss.AdaptiveColor{Light: "8", Dark: "8"}
)

This file defines the common defaults and styles for the UI components.

View Source
var DefaultConfirmKeyMap = ConfirmKeyMap{
	Yes: key.NewBinding(
		key.WithKeys("y", "Y"),
		key.WithHelp("y", "yes"),
	),
	No: key.NewBinding(
		key.WithKeys("n", "N"),
		key.WithHelp("n", "no"),
	),
	Accept: key.NewBinding(
		key.WithKeys("enter", "tab"),
		key.WithHelp("enter/tab", "accept"),
	),
}

DefaultConfirmKeyMap is the default key map for a Confirm field.

View Source
var DefaultConfirmStyle = ConfirmStyle{
	Key: NewStyle().Foreground(Magenta),
}

DefaultConfirmStyle is the default style for a Confirm field.

View Source
var DefaultFormKeyMap = FormKeyMap{
	Cancel: key.NewBinding(
		key.WithKeys("ctrl+c"),
		key.WithHelp("ctrl+c", "cancel"),
	),
}

DefaultFormKeyMap is the default key map for a Form.

View Source
var DefaultFormStyle = FormStyle{
	Error:         NewStyle().Foreground(Red),
	Title:         _titleStyle,
	Description:   _descriptionStyle,
	AcceptedTitle: _acceptedTitleStyle,

	AcceptedField: NewStyle().Faint(true),
}

DefaultFormStyle is the default style for a Form.

View Source
var DefaultInputKeyMap = InputKeyMap{
	Accept: key.NewBinding(
		key.WithKeys("enter", "tab"),
		key.WithHelp("enter/tab", "accept"),
	),
}

DefaultInputKeyMap is the default key map for an input field.

View Source
var DefaultInputStyle = InputStyle{}

DefaultInputStyle is the default style for an input field.

View Source
var DefaultListKeyMap = ListKeyMap{
	Up: key.NewBinding(
		key.WithKeys("up", "k"),
		key.WithHelp("up/k", "go up"),
	),
	Down: key.NewBinding(
		key.WithKeys("down", "j"),
		key.WithHelp("down/j", "go down"),
	),
	Accept: key.NewBinding(
		key.WithKeys("enter", "tab"),
		key.WithHelp("enter/tab", "accept"),
	),
}

DefaultListKeyMap specifies the default key bindings for List.

View Source
var DefaultListStyle = ListStyle{
	Cursor:            NewStyle().Foreground(Yellow).Bold(true).SetString("▶"),
	ItemTitle:         NewStyle().Foreground(Gray),
	SelectedItemTitle: NewStyle().Foreground(Yellow),
}

DefaultListStyle is the default style for a List.

View Source
var DefaultMultiSelectKeyMap = MultiSelectKeyMap{
	Up: key.NewBinding(
		key.WithKeys("up", "k"),
		key.WithHelp("up/k", "move up"),
	),
	Down: key.NewBinding(
		key.WithKeys("down", "j"),
		key.WithHelp("down/j", "move down"),
	),
	Toggle: key.NewBinding(
		key.WithKeys(" ", "right"),
		key.WithHelp("space", "toggle split"),
	),
	Accept: key.NewBinding(
		key.WithKeys("enter", "tab"),
		key.WithHelp("enter/tab", "accept"),
	),
}

DefaultMultiSelectKeyMap is the default key map for a MultiSelect.

View Source
var DefaultMultiSelectStyle = MultiSelectStyle{
	Cursor:     NewStyle().Foreground(Yellow).Bold(true).SetString("▶"),
	Done:       NewStyle().Foreground(Green).SetString("Done"),
	ScrollUp:   NewStyle().Foreground(Gray).SetString("▲▲▲"),
	ScrollDown: NewStyle().Foreground(Gray).SetString("▼▼▼"),
}

DefaultMultiSelectStyle is the default style for a MultiSelect.

View Source
var DefaultOpenEditorKeyMap = OpenEditorKeyMap{
	Edit: key.NewBinding(
		key.WithKeys("e"),
		key.WithHelp("e", "open editor"),
	),
	Accept: key.NewBinding(
		key.WithKeys("enter", "tab"),
		key.WithHelp("enter/tab", "accept"),
	),
}

DefaultOpenEditorKeyMap is the default key map for an OpenEditor field.

View Source
var DefaultOpenEditorStyle = OpenEditorStyle{
	Key:             NewStyle().Foreground(Magenta),
	Editor:          NewStyle().Foreground(Green),
	NoEditorMessage: "please set an editor",
}

DefaultOpenEditorStyle is the default style for an OpenEditor field.

View Source
var DefaultSelectKeyMap = SelectKeyMap{
	Up: key.NewBinding(
		key.WithKeys("up"),
		key.WithHelp("up", "go up"),
	),
	Down: key.NewBinding(
		key.WithKeys("down"),
		key.WithHelp("down", "go down"),
	),
	Accept: key.NewBinding(
		key.WithKeys("enter", "tab"),
		key.WithHelp("enter/tab", "accept"),
	),
	DeleteFilterChar: key.NewBinding(
		key.WithKeys("backspace", "ctrl+h"),
		key.WithHelp("backspace", "delete filter character"),
	),
}

DefaultSelectKeyMap is the default key map for a Select.

View Source
var DefaultSelectStyle = SelectStyle{
	Selected:     NewStyle().Foreground(Yellow),
	Highlight:    NewStyle().Foreground(Cyan),
	ScrollMarker: NewStyle().Foreground(Gray),
}

DefaultSelectStyle is the default style for a Select.

Renderer is a lipgloss renderer that writes to stderr.

We print prompts to stderr, so that's what we should use to check for colorization of lipgloss.

Functions

func AcceptField

func AcceptField() tea.Msg

AcceptField is a tea.Cmd to accept the currently focused field.

It should be returned by a field's [Update] method to accept the field and move to the next one.

func ComparableOptions

func ComparableOptions[T comparable](selected T, opts ...T) func(*Select[T])

ComparableOptions creates a list of options from a list of comparable values and sets the selected option.

The defeault string representation of the value is used as the label.

func NewStyle

func NewStyle() lipgloss.Style

NewStyle returns a new lipgloss style based on our default renderer.

func Run

func Run(f Field, opts ...RunOption) error

Run presents a single field to the user and blocks until it's accepted or canceled.

This is a convenience function for forms with just one field.

func SkipField

func SkipField() tea.Msg

SkipField is a tea.Cmd to skip the currently focused field.

func WithInput

func WithInput(r io.Reader) func(*runOptions)

WithInput sets the input stream for the form.

func WithOutput

func WithOutput(w io.Writer) func(*runOptions)

WithOutput sets the output stream for the form.

Types

type Confirm

type Confirm struct {
	KeyMap ConfirmKeyMap
	Style  ConfirmStyle
	// contains filtered or unexported fields
}

Confirm is a boolean confirmation field that takes a yes or no answer.

func NewConfirm

func NewConfirm() *Confirm

NewConfirm builds a new confirm field that prompts the user with a yes or no question.

func (*Confirm) Description

func (c *Confirm) Description() string

Description returns the description for the confirm field.

func (*Confirm) Err

func (c *Confirm) Err() error

Err reports any errors in the confirm field.

func (*Confirm) Init

func (c *Confirm) Init() tea.Cmd

Init initializes the field.

func (*Confirm) Render

func (c *Confirm) Render(w Writer)

Render renders the confirm field to the given writer.

func (*Confirm) Title

func (c *Confirm) Title() string

Title returns the title for the confirm field.

func (*Confirm) Update

func (c *Confirm) Update(msg tea.Msg) tea.Cmd

Update handles a bubbletea event.

func (*Confirm) Value

func (c *Confirm) Value() bool

Value returns the current value of the confirm field.

func (*Confirm) WithDescription

func (c *Confirm) WithDescription(desc string) *Confirm

WithDescription sets the desc for the confirm field.

func (*Confirm) WithDescriptionf

func (c *Confirm) WithDescriptionf(format string, args ...interface{}) *Confirm

WithDescriptionf is a variant of WithDescription that accepts a format string.

func (*Confirm) WithTitle

func (c *Confirm) WithTitle(title string) *Confirm

WithTitle sets the title for the confirm field.

func (*Confirm) WithTitlef

func (c *Confirm) WithTitlef(format string, args ...interface{}) *Confirm

WithTitlef is a variant of WithTitle that accepts a format string.

func (*Confirm) WithValue

func (c *Confirm) WithValue(value *bool) *Confirm

WithValue sets the destination for the confirm field. The result of the field will be written to the given boolean pointer. The pointer's current value will be used as the default.

type ConfirmKeyMap

type ConfirmKeyMap struct {
	Yes    key.Binding
	No     key.Binding
	Accept key.Binding
}

ConfirmKeyMap defines the key bindings for Confirm.

type ConfirmStyle

type ConfirmStyle struct {
	Key lipgloss.Style // how to highlight keys
}

ConfirmStyle configures the appearance of a Confirm field.

type Deferred

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

Deferred is a field that is not constructed until initialization time.

This is useful for fields that depend on other fields.

func Defer

func Defer(fn func() Field) *Deferred

Defer defers field construction using the given function. If the function returns nil, the field will be ignored.

func (*Deferred) Description

func (d *Deferred) Description() string

Description returns the description of the deferred field.

func (*Deferred) Err

func (d *Deferred) Err() error

Err returns an error if the field is in an error state.

func (*Deferred) Init

func (d *Deferred) Init() tea.Cmd

Init initializes the field.

func (*Deferred) Render

func (d *Deferred) Render(w Writer)

Render renders the deferred field.

func (*Deferred) Title

func (d *Deferred) Title() string

Title returns the title of the deferred field.

func (*Deferred) Update

func (d *Deferred) Update(msg tea.Msg) tea.Cmd

Update receives a new event.

type Editor

type Editor struct {
	// Command is the editor command to run.
	//
	// This may be a shell command like:
	//
	//	FOO=bar gvim --nofork
	//
	// or a binary name like:
	//
	//	nvim
	//
	// For the former case, we'll use 'sh -c' to run the command.
	Command string

	// Ext is the extension to assign to the file
	// before opening the editor.
	//
	// Defaults to "md".
	Ext string
}

Editor configures the editor to open.

func DefaultEditor

func DefaultEditor() Editor

DefaultEditor returns the default editor configuration.

type Field

type Field interface {
	// Init initializes the field.
	// This is called right before the field is first rendered,
	// not when the form is initialized.
	Init() tea.Cmd
	Update(msg tea.Msg) tea.Cmd
	Render(Writer)

	// Err reports any errors for the field at render time.
	// These will be rendered in red below the field.
	//
	// It is the field's responsibility to ensure
	// that it does not post [AcceptField] while in an error state.
	Err() error

	// Title is a short title for the field.
	// This is always visible.
	Title() string

	// Description is a longer description of the field.
	// This is visible only while the field is focused.
	Description() string
}

Field is a single field in a form.

type Form

type Form struct {
	KeyMap FormKeyMap
	Style  FormStyle
	// contains filtered or unexported fields
}

Form presents a series of fields for the user to fill.

func NewForm

func NewForm(fields ...Field) *Form

NewForm builds a new form with the given fields.

func (*Form) Err

func (f *Form) Err() error

Err reports any errors that occurred during the form's execution or from any of the fields.

func (*Form) Init

func (f *Form) Init() tea.Cmd

Init initializes the form.

func (*Form) Run

func (f *Form) Run(opts ...RunOption) error

Run runs the form and blocks until it's accepted or canceled. It returns a combination of all errors returned by the fields.

func (*Form) Update

func (f *Form) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*Form) View

func (f *Form) View() string

View implements tea.Model.

type FormKeyMap

type FormKeyMap struct {
	Cancel key.Binding
}

FormKeyMap defines the key bindings for a form. See DefaultFormKeyMap for default values.

type FormStyle

type FormStyle struct {
	Error lipgloss.Style

	Title         lipgloss.Style
	Description   lipgloss.Style
	AcceptedTitle lipgloss.Style

	AcceptedField lipgloss.Style
}

FormStyle configures the appearance of a Form.

type Input

type Input struct {
	KeyMap InputKeyMap
	Style  InputStyle
	// contains filtered or unexported fields
}

Input is a text input field. It accepts a single line of text.

func NewInput

func NewInput() *Input

NewInput builds a new input field.

func (*Input) Description

func (i *Input) Description() string

Description returns the description of the input field.

func (*Input) Err

func (i *Input) Err() error

Err reports any errors encountered during the operation. The error is nil if the input was accepted.

func (*Input) Init

func (i *Input) Init() tea.Cmd

Init initializes the field.

func (*Input) Render

func (i *Input) Render(w Writer)

Render renders the input field.

func (*Input) Title

func (i *Input) Title() string

Title returns the title of the input field.

func (*Input) Update

func (i *Input) Update(msg tea.Msg) tea.Cmd

Update handles a bubbletea event.

func (*Input) WithDescription

func (i *Input) WithDescription(desc string) *Input

WithDescription sets the description of the input field.

func (*Input) WithTitle

func (i *Input) WithTitle(title string) *Input

WithTitle sets the title of the input field.

func (*Input) WithValidate

func (i *Input) WithValidate(f func(string) error) *Input

WithValidate sets a validation function for the input field.

The field will not accept the input until the validation function returns nil.

func (*Input) WithValue

func (i *Input) WithValue(value *string) *Input

WithValue sets the destination for the input field. If the value is non-empty, it will be used as the initial value.

type InputKeyMap

type InputKeyMap struct {
	Accept key.Binding
}

InputKeyMap defines the key bindings for an input field.

type InputStyle

type InputStyle struct{}

InputStyle defines the styles for an input field.

type List

type List[T any] struct {
	KeyMap ListKeyMap
	Style  ListStyle
	// contains filtered or unexported fields
}

List is a prompt that allows selecting from a list of options. This is similar to Select but without the fuzzy filter. Each item in a List can have a title, description, and a value.

func NewList

func NewList[T any]() *List[T]

NewList creates a new List with default settings.

func (*List[T]) Description

func (l *List[T]) Description() string

Description retrieves the description of the List.

func (*List[T]) Err

func (l *List[T]) Err() error

Err returns nil.

func (*List[T]) Init

func (l *List[T]) Init() tea.Cmd

Init initializes the List.

func (*List[T]) Render

func (l *List[T]) Render(w Writer)

Render renders the list to the screen.

func (*List[T]) Title

func (l *List[T]) Title() string

Title retrieves the title of the List.

func (*List[T]) Update

func (l *List[T]) Update(msg tea.Msg) tea.Cmd

Update receives a message from bubbletea and updates the internal state of the list.

func (*List[T]) Value

func (l *List[T]) Value() *T

Value retrieevs the selected item's value.

func (*List[T]) With

func (l *List[T]) With(f func(l *List[T])) *List[T]

With is a helper to pass in a list of customizations at once.

func (*List[T]) WithDescription

func (l *List[T]) WithDescription(desc string) *List[T]

WithDescription sets the description of the List.

func (*List[T]) WithItems

func (l *List[T]) WithItems(items ...ListItem[T]) *List[T]

WithItems fills the list with items. By default the first of these items will be selected.

func (*List[T]) WithSelected

func (l *List[T]) WithSelected(selected int) *List[T]

WithSelected sets the index of the selected item.

func (*List[T]) WithTitle

func (l *List[T]) WithTitle(title string) *List[T]

WithTitle sets the title of the List.

func (*List[T]) WithValue

func (l *List[T]) WithValue(value *T) *List[T]

WithValue sets the destination pointer for the selected item's value. When the user selects an item, the value will be copied to the pointer.

type ListItem

type ListItem[T any] struct {
	Title       string
	Description func(focused bool) string
	Value       T
}

ListItem is an item in a List.

type ListKeyMap

type ListKeyMap struct {
	Up     key.Binding
	Down   key.Binding
	Accept key.Binding
}

ListKeyMap defines key bindings for List.

type ListStyle

type ListStyle struct {
	Cursor lipgloss.Style

	ItemTitle         lipgloss.Style
	SelectedItemTitle lipgloss.Style
}

ListStyle defines the styles for List.

type MultiSelect

type MultiSelect[T any] struct {
	KeyMap MultiSelectKeyMap
	Style  MultiSelectStyle
	// contains filtered or unexported fields
}

MultiSelect is a prompt that allows selecting one or more options.

func NewMultiSelect

func NewMultiSelect[T any](render func(Writer, int, MultiSelectOption[T])) *MultiSelect[T]

NewMultiSelect constructs a new multi-select field.

func (*MultiSelect[T]) Description

func (s *MultiSelect[T]) Description() string

Description returns the description of the multi-select field.

func (*MultiSelect[T]) Err

func (s *MultiSelect[T]) Err() error

Err returns nil.

func (*MultiSelect[T]) Init

func (s *MultiSelect[T]) Init() tea.Cmd

Init initializes the multi-select field.

func (*MultiSelect[T]) Render

func (s *MultiSelect[T]) Render(w Writer)

Render renders the multi-select field.

func (*MultiSelect[T]) Selected

func (s *MultiSelect[T]) Selected() []int

Selected returns the indexes of the selected options.

func (*MultiSelect[T]) Title

func (s *MultiSelect[T]) Title() string

Title returns the title of the multi-select field.

func (*MultiSelect[T]) Update

func (s *MultiSelect[T]) Update(msg tea.Msg) tea.Cmd

Update updates the multi-select field.

func (*MultiSelect[T]) Value

func (s *MultiSelect[T]) Value() []T

Value returns a slice of the selected values.

func (*MultiSelect[T]) WithDescription

func (s *MultiSelect[T]) WithDescription(desc string) *MultiSelect[T]

WithDescription sets the description of the multi-select field.

func (*MultiSelect[T]) WithOptions

func (s *MultiSelect[T]) WithOptions(opts ...MultiSelectOption[T]) *MultiSelect[T]

WithOptions sets the options for the multi-select field. Options will be presented in the order they are provided. The existing options, if any, will be replaced.

func (*MultiSelect[T]) WithTitle

func (s *MultiSelect[T]) WithTitle(title string) *MultiSelect[T]

WithTitle sets the title of the multi-select field.

type MultiSelectKeyMap

type MultiSelectKeyMap struct {
	Up, Down key.Binding
	Toggle   key.Binding
	Accept   key.Binding
}

MultiSelectKeyMap defines the key bindings for MultiSelect.

type MultiSelectOption

type MultiSelectOption[T any] struct {
	// Value of the option.
	Value T

	// Selected indicates whether the option is already selected.
	Selected bool

	// Skip indicates whether the option should be skipped.
	// Skipped options are not selectable
	// and will never be included in the result.
	Skip bool
}

MultiSelectOption is an option for a multi-select field.

type MultiSelectStyle

type MultiSelectStyle struct {
	// Cursor is the string to use for the cursor.
	Cursor lipgloss.Style

	// Done is the string for the Done button.
	Done lipgloss.Style

	// ScrollUp is the string for the scroll up marker.
	ScrollUp lipgloss.Style

	// ScrollDown is the string for the scroll down marker.
	ScrollDown lipgloss.Style
}

MultiSelectStyle defines the styles for MultiSelect.

type OpenEditor

type OpenEditor struct {
	KeyMap OpenEditorKeyMap
	Style  OpenEditorStyle
	Editor Editor
	// contains filtered or unexported fields
}

OpenEditor is a dialog that asks the user to press a key to open an editor and write a message.

func NewOpenEditor

func NewOpenEditor(editor Editor) *OpenEditor

NewOpenEditor builds an OpenEditor field. It will prompt the user to open an editor and write a message, or accept the current value.

func (*OpenEditor) Description

func (a *OpenEditor) Description() string

Description returns the description for the field.

func (*OpenEditor) Err

func (a *OpenEditor) Err() error

Err reports any errors encountered during the operation.

func (*OpenEditor) Init

func (a *OpenEditor) Init() tea.Cmd

Init initializes the field.

func (*OpenEditor) Render

func (a *OpenEditor) Render(w Writer)

Render renders the field to the screen.

func (*OpenEditor) Title

func (a *OpenEditor) Title() string

Title returns the title for the field.

func (*OpenEditor) Update

func (a *OpenEditor) Update(msg tea.Msg) tea.Cmd

Update receives a new event from bubbletea and updates the field's internal state.

func (*OpenEditor) WithDescription

func (a *OpenEditor) WithDescription(desc string) *OpenEditor

WithDescription sets the description for the field.

func (*OpenEditor) WithTitle

func (a *OpenEditor) WithTitle(title string) *OpenEditor

WithTitle sets the title for the field.

func (*OpenEditor) WithValue

func (a *OpenEditor) WithValue(value *string) *OpenEditor

WithValue specifies the value to edit. The current value will be used as the initial content of the editor. The value will be updated when the editor is closed, or left unchanged if the user skips the editor.

type OpenEditorKeyMap

type OpenEditorKeyMap struct {
	Edit   key.Binding
	Accept key.Binding
}

OpenEditorKeyMap defines the key bindings for OpenEditor.

type OpenEditorStyle

type OpenEditorStyle struct {
	Key    lipgloss.Style // how to highlight keys
	Editor lipgloss.Style

	NoEditorMessage string
}

OpenEditorStyle defines the display style for OpenEditor.

type RunOption

type RunOption func(*runOptions)

RunOption is an option for a form's Run method.

type Select

type Select[T any] struct {
	KeyMap SelectKeyMap
	Style  SelectStyle
	// contains filtered or unexported fields
}

Select is a prompt that allows selecting from a list of options using a fuzzy filter.

func NewSelect

func NewSelect[T any]() *Select[T]

NewSelect builds a new Select field.

func (*Select[T]) Description

func (s *Select[T]) Description() string

Description returns the description of the select field.

func (*Select[T]) Err

func (s *Select[T]) Err() error

Err reports any errors in the select field.

func (*Select[T]) Init

func (s *Select[T]) Init() tea.Cmd

Init initializes the field.

func (*Select[T]) Render

func (s *Select[T]) Render(out Writer)

Render renders the select field.

func (*Select[T]) Title

func (s *Select[T]) Title() string

Title returns the title of the select field.

func (*Select[T]) Update

func (s *Select[T]) Update(msg tea.Msg) tea.Cmd

Update receives messages from bubbletea.

func (*Select[T]) Value

func (s *Select[T]) Value() T

Value reports the current value of the select field.

func (*Select[T]) With

func (s *Select[T]) With(f func(*Select[T])) *Select[T]

With runs the given function with the select field.

func (*Select[T]) WithDescription

func (s *Select[T]) WithDescription(desc string) *Select[T]

WithDescription sets the description for the select field.

func (*Select[T]) WithOptions

func (s *Select[T]) WithOptions(opts ...SelectOption[T]) *Select[T]

WithOptions sets the available options for the select field. The options will be presented in the order they are provided. Existing options will be replaced.

func (*Select[T]) WithSelected

func (s *Select[T]) WithSelected(selected int) *Select[T]

WithSelected sets the selected option for the select field.

func (*Select[T]) WithTitle

func (s *Select[T]) WithTitle(title string) *Select[T]

WithTitle sets the title for the select field.

func (*Select[T]) WithValue

func (s *Select[T]) WithValue(value *T) *Select[T]

WithValue sets the destination for the select field. The existing value, if any, will be selected by default.

func (*Select[T]) WithVisible

func (s *Select[T]) WithVisible(visible int) *Select[T]

WithVisible sets the number of visible options in the select field. If unset, a default is picked based on the terminal height.

type SelectKeyMap

type SelectKeyMap struct {
	Up     key.Binding
	Down   key.Binding
	Accept key.Binding

	DeleteFilterChar key.Binding
}

SelectKeyMap defines the key bindings for Select.

type SelectOption

type SelectOption[T any] struct {
	Label string
	Value T
}

SelectOption is a single option for a select field.

type SelectStyle

type SelectStyle struct {
	Selected  lipgloss.Style
	Highlight lipgloss.Style

	ScrollMarker lipgloss.Style
}

SelectStyle defines the styles for Select.

type Writer

type Writer interface {
	io.Writer
	io.StringWriter
}

Writer receives a rendered view of a Field.

Directories

Path Synopsis
Package fliptree renders a tree of nodes as text in reverse: children first, then parent.
Package fliptree renders a tree of nodes as text in reverse: children first, then parent.
Package widget implements more complex user interface components on top of the primitives offered in the ui package.
Package widget implements more complex user interface components on top of the primitives offered in the ui package.

Jump to

Keyboard shortcuts

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