Documentation
¶
Overview ¶
Package ui is rexuikit's native content kit. Every component renders cells that all carry an explicit background, so a Rex floating layer never shows the terminal through them.
Index ¶
- type Card
- type Confirm
- func (c *Confirm) Default(v bool) *Confirm
- func (b *Confirm) Err() error
- func (c *Confirm) Get() bool
- func (b *Confirm) Key() string
- func (c *Confirm) Labels(yes, no string) *Confirm
- func (c *Confirm) NaturalSize() (cols, rows int)
- func (c *Confirm) OnChange(fn func(value any) tea.Cmd) *Confirm
- func (c *Confirm) Value() any
- type Dialog
- func (d *Dialog) Init() tea.Cmd
- func (d *Dialog) NaturalSize() (cols, rows int)
- func (d *Dialog) OnFirstPaint(fn func()) *Dialog
- func (d *Dialog) SetBody(lines []string)
- func (d *Dialog) SetHint(s string)
- func (d *Dialog) Theme() theme.Theme
- func (d *Dialog) Update(msg tea.Msg) tea.Cmd
- func (d *Dialog) View() string
- func (d *Dialog) WithHint(s string) *Dialog
- func (d *Dialog) WithThemeFunc(fn func(color.Color) theme.Theme) *Dialog
- type Field
- type Form
- func (f *Form) Focused() int
- func (f *Form) Init() tea.Cmd
- func (f *Form) NaturalSize() (cols, rows int)
- func (f *Form) OnFirstPaint(fn func()) *Form
- func (f *Form) Render() string
- func (f *Form) Status() FormStatus
- func (f *Form) Theme() theme.Theme
- func (f *Form) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (f *Form) Values() Values
- func (f *Form) View() tea.View
- func (f *Form) WithHint(s string) *Form
- func (f *Form) WithSubtitle(s string) *Form
- func (f *Form) WithThemeFunc(fn func(color.Color) theme.Theme) *Form
- type FormCancelledMsg
- type FormStatus
- type FormSubmittedMsg
- type Hint
- type HintBar
- type InfoClosedMsg
- type InfoPanel
- func (p *InfoPanel) Init() tea.Cmd
- func (p *InfoPanel) NaturalSize() (cols, rows int)
- func (p *InfoPanel) OnFirstPaint(fn func()) *InfoPanel
- func (p *InfoPanel) Rebuild()
- func (p *InfoPanel) Theme() theme.Theme
- func (p *InfoPanel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (p *InfoPanel) View() tea.View
- func (p *InfoPanel) WithHint(s string) *InfoPanel
- func (p *InfoPanel) WithRefresh(d time.Duration) *InfoPanel
- func (p *InfoPanel) WithThemeFunc(fn func(color.Color) theme.Theme) *InfoPanel
- type List
- func (l *List) Init() tea.Cmd
- func (l *List) NaturalSize() (cols, rows int)
- func (l *List) OnFirstPaint(fn func()) *List
- func (l *List) Query() string
- func (l *List) Selected() (Row, bool)
- func (l *List) Theme() theme.Theme
- func (l *List) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (l *List) View() tea.View
- func (l *List) WithThemeFunc(fn func(color.Color) theme.Theme) *List
- func (l *List) WithTitle(s string) *List
- type ListCancelledMsg
- type ListSelectedMsg
- type Loader
- type MultiSelect
- func (m *MultiSelect) Default(values ...string) *MultiSelect
- func (b *MultiSelect) Err() error
- func (m *MultiSelect) Filterable() *MultiSelect
- func (m *MultiSelect) Get() []string
- func (b *MultiSelect) Key() string
- func (m *MultiSelect) Min(n int) *MultiSelect
- func (m *MultiSelect) NaturalSize() (cols, rows int)
- func (m *MultiSelect) OnChange(fn func(value any) tea.Cmd) *MultiSelect
- func (m *MultiSelect) Options(opts ...Option) *MultiSelect
- func (m *MultiSelect) Rows(n int) *MultiSelect
- func (m *MultiSelect) SetOptions(opts ...Option)
- func (m *MultiSelect) Value() any
- type Notice
- type NoticeKind
- type Option
- type OptionsMsg
- type Pane
- type Row
- type Select
- func (s *Select) Default(v string) *Select
- func (s *Select) Err() error
- func (s *Select) Filterable() *Select
- func (s *Select) Get() string
- func (b *Select) Key() string
- func (s *Select) Loader(fn Loader) *Select
- func (s *Select) NaturalSize() (cols, rows int)
- func (s *Select) OnChange(fn func(value any) tea.Cmd) *Select
- func (s *Select) Options(opts ...Option) *Select
- func (s *Select) Pending() *Select
- func (s *Select) Rows(n int) *Select
- func (s *Select) Selected() (Option, bool)
- func (s *Select) SetOptions(opts ...Option)
- func (s *Select) Value() any
- type Tabs
- type Text
- func (f *Text) CharLimit(n int) *Text
- func (f *Text) Default(s string) *Text
- func (b *Text) Err() error
- func (f *Text) Get() string
- func (b *Text) Key() string
- func (f *Text) NaturalSize() (cols, rows int)
- func (f *Text) OnChange(fn func(value any) tea.Cmd) *Text
- func (f *Text) Placeholder(s string) *Text
- func (f *Text) Validator(fn func(string) error) *Text
- func (f *Text) Value() any
- type TextArea
- func (f *TextArea) CharLimit(n int) *TextArea
- func (f *TextArea) Default(s string) *TextArea
- func (b *TextArea) Err() error
- func (f *TextArea) Get() string
- func (b *TextArea) Key() string
- func (f *TextArea) Lines(n int) *TextArea
- func (f *TextArea) NaturalSize() (cols, rows int)
- func (f *TextArea) OnChange(fn func(value any) tea.Cmd) *TextArea
- func (f *TextArea) Placeholder(s string) *TextArea
- func (f *TextArea) Validator(fn func(string) error) *TextArea
- func (f *TextArea) Value() any
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card struct {
// contains filtered or unexported fields
}
Card is the frame a form or panel is drawn in.
The default Card has no border and no title of its own. Inside a Rex layer, Rex's border and title bar are the frame and the surface's label is the title, so the card fills its whole w×h frame edge to edge with the surface colour and draws only padding, an optional subtitle, the content and a hint bar on the bottom row. Bordered opts into a drawn border and title for a host that has no Rex chrome (a plain terminal, a golden test).
Card is a value; its With* and Bordered methods return modified copies.
func NewCard ¶
func NewCard(t theme.Theme, profile colorprofile.Profile) Card
NewCard returns a borderless card in theme t. profile is the terminal's colour profile; on ANSI16 or lower the solid fill is skipped (paint.Fill).
func (Card) Bordered ¶
Bordered returns the card with a rounded border in the Border colour and title set into the top edge. Use it only where Rex draws no chrome of its own.
func (Card) NaturalSize ¶
NaturalSize is the card's size in cells for content: the smallest frame that shows the content, subtitle and hint without truncation. Surfaces use it to size the Rex layer to the form.
func (Card) Render ¶
Render draws content in a w×h frame. A w or h of zero or less means the natural size on that axis. Content wider or taller than the frame is cut (columns by ANSI-aware truncation, rows from the bottom) rather than reflowed, and the hint bar always keeps the last row.
func (Card) WithHint ¶
WithHint sets the bottom hint bar's text, such as "enter submit · esc cancel".
func (Card) WithSubtitle ¶
WithSubtitle sets a one-line subtitle drawn inside the content area, above the content, in the Muted colour.
type Confirm ¶
type Confirm struct {
// contains filtered or unexported fields
}
Confirm is a yes/no choice: left/right (h/l) toggle, y and n choose.
func NewConfirm ¶
NewConfirm returns a yes/no choice that starts on No.
func (*Confirm) NaturalSize ¶
type Dialog ¶
type Dialog struct {
// contains filtered or unexported fields
}
Dialog is a solid card holding a title, pre-rendered body lines and a hint bar, for confirmations whose keys are not form keys (a staged `d d`, a mode-registry key). It routes no keys: the caller's model reads them and decides, and passes every other message to Update for size and theme.
func NewDialog ¶
NewDialog returns a dialog in theme t; profile is the terminal's colour profile (see NewCard). body lines may carry their own styling; spans that set no background get the Surface colour from the card's fill.
func (*Dialog) Init ¶
Init asks the terminal for its background colour; bubbletea sends BackgroundColorMsg only on request.
func (*Dialog) NaturalSize ¶
NaturalSize is the smallest frame showing the title, body and hint uncut.
func (*Dialog) OnFirstPaint ¶
OnFirstPaint sets a hook run once, after the first non-empty View.
func (*Dialog) SetBody ¶
SetBody replaces the body lines, for a dialog whose text changes between stages of the caller's key machine.
func (*Dialog) Update ¶
Update applies window size, background colour and colour profile messages and ignores everything else, keys included.
type Field ¶
type Field interface {
// Key names the field's value in the form's Values.
Key() string
// Value is the field's current value: a string for Text, TextArea and
// Select, a bool for Confirm.
Value() any
// Err is the error the field currently shows, or nil.
Err() error
// NaturalSize is the field's size in cells at its natural width:
// label, well rows and the status row.
NaturalSize() (cols, rows int)
// contains filtered or unexported methods
}
Field is one input of a Form: Text, TextArea, Select or Confirm. The set is closed (the unexported methods are the rendering and focus contract the Form drives), so a Form can rely on every field drawing a label, a well and a status row.
type Form ¶
type Form struct {
// contains filtered or unexported fields
}
Form hosts fields on one Card: every field visible at once, enter or tab validates the focused field and moves on, shift+tab goes back, enter on the last field validates everything and submits, esc cancels.
It is a bubbletea model. Its size comes from tea.WindowSizeMsg; before one arrives it draws at NaturalSize, which is also what a surface should size the Rex layer to.
func NewForm ¶
NewForm returns a form over fields in theme t, which is the first-frame theme until a BackgroundColorMsg re-themes it. profile is the terminal's colour profile (see NewCard). Field keys must be unique.
func (*Form) Init ¶
Init asks the terminal for its background colour (bubbletea sends BackgroundColorMsg only on request), focuses the first field and starts every Select's loader.
func (*Form) NaturalSize ¶
NaturalSize is the form's size in cells with every field at its natural width and the wider of the two default hints, so the size does not change as the focus moves.
func (*Form) OnFirstPaint ¶
OnFirstPaint sets a hook run once, after the first non-empty View.
func (*Form) Render ¶
Render draws the form at the window size, or at NaturalSize before the first WindowSizeMsg.
func (*Form) Status ¶
func (f *Form) Status() FormStatus
Status reports whether the form is still open, submitted or cancelled.
func (*Form) Update ¶
Update implements tea.Model. Keys and pastes go to the focused field; any other message goes to every field, which is how an OptionsMsg reaches its Select wherever the focus is.
func (*Form) WithHint ¶
WithHint replaces the default hint bar, which names enter as "next" or "submit" depending on the focused field.
func (*Form) WithSubtitle ¶
WithSubtitle sets the card's in-content subtitle.
type FormCancelledMsg ¶
type FormCancelledMsg struct{}
FormCancelledMsg is sent when the user presses esc or ctrl+c. As with ListCancelledMsg the host decides what that means; a Form never quits the program itself, so it can be embedded in a larger model.
type FormStatus ¶
type FormStatus int
FormStatus is where a Form is in its life.
const ( FormPending FormStatus = iota FormSubmitted FormCancelled )
type FormSubmittedMsg ¶
type FormSubmittedMsg struct {
Values Values
}
type HintBar ¶ added in v0.3.0
type HintBar struct {
// contains filtered or unexported fields
}
HintBar is a one-row strip of key/description pairs on the theme's Well, with optional status text on its left. It is a pure render value: Render returns a string and the bar starts no timer and returns no tea.Cmd.
Every cell of the row, padding and separators included, is drawn through Theme.On with Well as the background, so the row has no see-through cells inside a Rex layer and needs no fill pass.
func NewHintBar ¶ added in v0.3.0
NewHintBar returns a hint bar in theme t.
func (HintBar) Render ¶ added in v0.3.0
Render returns the bar exactly width cells wide. Hints are kept from the first, and the trailing ones that do not fit are dropped whole: a hint is never cut in half. width below one yields an empty string.
func (HintBar) WithStatus ¶ added in v0.3.0
WithStatus returns the bar with status shown at its left edge. Status outranks hints when space runs short: hints are dropped first, and only a status wider than the bar itself is truncated.
type InfoClosedMsg ¶
type InfoClosedMsg struct{}
InfoClosedMsg is sent when the user presses esc or q. As with ListCancelledMsg the host decides what closing means.
type InfoPanel ¶
type InfoPanel struct {
// contains filtered or unexported fields
}
InfoPanel is a scrollable, painted viewer over caller-rendered lines.
Body receives the usable column count and returns pre-rendered lines; the panel never styles or wraps them, so a caller (forge's quick info) keeps its own panel colours. Cells the lines leave without a background are closed by the Card's fill pass. With a refresh interval set the panel calls Body again on every tick and keeps the scroll position, clamped when the new body is shorter.
func NewInfoPanel ¶
func NewInfoPanel(t theme.Theme, profile colorprofile.Profile, title string, body func(width int) []string) *InfoPanel
NewInfoPanel returns a viewer in theme t showing body's lines under title. An empty title omits the title row.
func (*InfoPanel) Init ¶
Init asks the terminal for its background colour (bubbletea sends BackgroundColorMsg only on request) and starts the refresh tick.
func (*InfoPanel) NaturalSize ¶
NaturalSize is the smallest frame that shows the title, up to twenty body lines and the hint without truncation.
func (*InfoPanel) OnFirstPaint ¶
OnFirstPaint registers fn to run once, right after the first View that produced a frame (see List.OnFirstPaint).
func (*InfoPanel) Rebuild ¶
func (p *InfoPanel) Rebuild()
Rebuild calls Body again at the current width and keeps the scroll position, clamped when the new body is shorter: what the refresh tick does, for a host that learns of new data on its own schedule.
func (*InfoPanel) Update ¶
Update implements tea.Model. A BackgroundColorMsg re-themes the panel's surface, title and hint and a ColorProfileMsg sets the profile its fill uses, as Form and Dialog do. The body's lines are the caller's and keep their own colours.
func (*InfoPanel) WithHint ¶
WithHint replaces the hint line. The scroll position is appended to it when the body is taller than the window.
func (*InfoPanel) WithRefresh ¶
WithRefresh makes the panel call Body again every d. Zero or less disables the tick.
type List ¶
type List struct {
// contains filtered or unexported fields
}
List is a filterable picker: typing narrows the rows by case-insensitive substring, up/down move the cursor, enter selects and esc cancels.
It is a bubbletea model that fills its whole frame through a borderless Card, so it is solid inside a Rex layer. Its natural size is computed from all rows and never from the current filter, so the layer a surface opens does not need to resize while the user types.
func NewList ¶
NewList returns a picker over rows in theme t. profile is the terminal's colour profile (see NewCard).
func (*List) Init ¶
Init asks the terminal for its background colour; bubbletea sends BackgroundColorMsg only on request.
func (*List) NaturalSize ¶
NaturalSize is the smallest frame that shows the filter line, up to ten rows, the optional title and the hint bar without truncation. It does not change as the filter narrows.
func (*List) OnFirstPaint ¶
OnFirstPaint registers fn to run once, right after the first View that produced a frame. It is how a host learns the picker is on screen (to record time to first paint or start deferred work) without owning the frame loop.
func (*List) Update ¶
Update implements tea.Model. A BackgroundColorMsg re-themes the picker and a ColorProfileMsg sets the profile its fill uses, as Form and Dialog do.
func (*List) WithThemeFunc ¶
WithThemeFunc replaces theme.FromBackground as the way a BackgroundColorMsg picks the theme, as Form.WithThemeFunc.
type ListCancelledMsg ¶
type ListCancelledMsg struct{}
ListCancelledMsg is sent when the user presses esc. The host decides what to do about it (close the surface, quit the program): a component that called tea.Quit itself could not be embedded in a larger model.
type ListSelectedMsg ¶
ListSelectedMsg is sent when the user presses enter on a row. Index is the row's position in the slice given to NewList, not in the filtered view.
type Loader ¶
Loader produces a Select's options after the first paint: the options, the value to preselect (ignored when no option has it), and an error that is shown in the field and blocks submit.
type MultiSelect ¶ added in v0.3.0
type MultiSelect struct {
// contains filtered or unexported fields
}
MultiSelect is a vertical checklist: space toggles the row under the cursor, up/down (and j/k unless the list is filterable) move it, enter goes through the form like every other field, and an optional filter narrows the rows as the user types.
The cursor, filter and scroll behaviour is a Select's: a MultiSelect drives one for its movement, so the two cannot drift apart. A choice belongs to an option value, not to a row, so it survives the filter hiding the row and a SetOptions that still has the value.
func NewMultiSelect ¶ added in v0.3.0
func NewMultiSelect(key, label string) *MultiSelect
NewMultiSelect returns a checklist whose chosen values are stored under key in the form's Values, titled label.
func (*MultiSelect) Default ¶ added in v0.3.0
func (m *MultiSelect) Default(values ...string) *MultiSelect
Default chooses the options with these values, replacing any earlier choice. A value no option has is ignored by Get.
func (*MultiSelect) Filterable ¶ added in v0.3.0
func (m *MultiSelect) Filterable() *MultiSelect
Filterable adds a filter line, as Select.Filterable does. Space still toggles, so a filter cannot contain a space.
func (*MultiSelect) Get ¶ added in v0.3.0
func (m *MultiSelect) Get() []string
Get is the chosen options' values, in option order. It is never nil.
func (*MultiSelect) Min ¶ added in v0.3.0
func (m *MultiSelect) Min(n int) *MultiSelect
Min requires at least n chosen options before the field validates; 0 (the default) allows none.
func (*MultiSelect) NaturalSize ¶ added in v0.3.0
func (m *MultiSelect) NaturalSize() (cols, rows int)
func (*MultiSelect) OnChange ¶ added in v0.3.0
func (m *MultiSelect) OnChange(fn func(value any) tea.Cmd) *MultiSelect
OnChange works as Text.OnChange. It runs when a toggle changes the chosen set.
func (*MultiSelect) Options ¶ added in v0.3.0
func (m *MultiSelect) Options(opts ...Option) *MultiSelect
Options sets the options. Values chosen by Default stay chosen.
func (*MultiSelect) Rows ¶ added in v0.3.0
func (m *MultiSelect) Rows(n int) *MultiSelect
Rows fixes the number of visible option rows, as Select.Rows does.
func (*MultiSelect) SetOptions ¶ added in v0.3.0
func (m *MultiSelect) SetOptions(opts ...Option)
SetOptions replaces the options, as Select.SetOptions does. Chosen values the new options lack drop out of Get. It does not run OnChange.
func (*MultiSelect) Value ¶ added in v0.3.0
func (m *MultiSelect) Value() any
Value is the chosen values joined by an unprintable separator, in option order: a string, because the form compares values with ==, which a slice would panic. Read the typed result with Get, or Values.Strings from a submitted form.
type Notice ¶ added in v0.3.0
type Notice struct {
Kind NoticeKind
Text string
// Spinner, when non-empty, replaces the kind glyph. The caller supplies
// the current frame (for example from a bubbles spinner) and re-renders;
// the Notice never animates itself.
Spinner string
}
Notice is a one-line toast or banner. It is a pure render value: it owns no timer and returns no tea.Cmd, so dismissal (a timeout, a keypress) stays with the caller, who simply stops rendering it.
func (Notice) Render ¶ added in v0.3.0
Render returns the notice as one row exactly width cells wide on the theme's Panel, which every status colour clears WCAG AA on. Text that does not fit is cut with an ellipsis; embedded newlines are flattened to spaces so the notice never grows past one row. width below one yields an empty string.
type NoticeKind ¶ added in v0.3.0
type NoticeKind int
NoticeKind picks a Notice's colour and glyph.
const ( // Info is neutral news, drawn in Accent. Info NoticeKind = iota // Success is a finished action, drawn in Done. Success // Warning is something that needs the user's attention, drawn in Need. Warning // Error is a failure, drawn in Danger. Error )
type OptionsMsg ¶
OptionsMsg delivers a Select's options. A Select with a Loader produces it from its Init command; a caller that marked a Select Pending sends it itself. A Select ignores an OptionsMsg addressed to another Select.
type Pane ¶ added in v0.3.0
type Pane struct {
// contains filtered or unexported fields
}
Pane is a titled, bordered box drawn at an exact size: the building block of a multi-pane dashboard. Unlike Card, which sits inside Rex's own frame, a Pane always draws its border, because a dashboard lays several of them side by side inside one surface.
The title sits in the top edge with an optional right-aligned context string (a count, a branch). The border is Accent when the pane has focus and Border otherwise. An optional scroll readout ("↑N ↓M") sits in the bottom edge. Body lines are clipped to the inner width and height, or padded up to them, and every cell is drawn on the pane's background (Panel by default), so the frame has no bare cells.
Pane is a pure render value like Card: no Init, no state. Its With* methods return modified copies.
func NewPane ¶ added in v0.3.0
func NewPane(t theme.Theme, profile colorprofile.Profile) Pane
NewPane returns an unfocused pane in theme t on the Panel background. profile is the terminal's colour profile; on ANSI16 or lower the solid fill is skipped (paint.Fill).
func (Pane) OnSurface ¶ added in v0.3.0
OnSurface draws the pane on the theme's Surface instead of Panel, for a pane that sits directly on the page rather than on a raised area.
func (Pane) Render ¶ added in v0.3.0
Render draws body in a w×h box, border included, so lipgloss.Width of the result is w and lipgloss.Height is h. A box smaller than 2×2 cannot hold a border and is returned as plain filled cells of that size. Body lines wider than the inner width are cut (ANSI-aware, no ellipsis, no reflow); lines beyond the inner height are dropped from the bottom.
func (Pane) WithContext ¶ added in v0.3.0
WithContext sets the string right-aligned in the top edge. It is dropped, whole, when it does not fit beside the title.
func (Pane) WithFocus ¶ added in v0.3.0
WithFocus sets whether the pane has focus (Accent border) or not (Border).
func (Pane) WithScroll ¶ added in v0.3.0
WithScroll sets the scroll readout: how many body lines lie above and below the visible window. Both zero hides the readout.
type Row ¶
Row is one choice in a List. Detail is optional secondary text drawn after the label in the Muted colour.
type Select ¶
type Select struct {
// contains filtered or unexported fields
}
Select is a vertical option list: `›` marks the chosen option, up/down (and j/k unless the list is filterable) move it, and an optional filter narrows the options as the user types.
func (*Select) Err ¶
Err implements Field. A loader error outlives edits: it stays until the form is cancelled.
func (*Select) Filterable ¶
Filterable adds a filter line: typed characters narrow the options by case-insensitive substring, backspace and ctrl+u edit the filter. j and k then type into the filter, so only up/down (and ctrl+p/ctrl+n) move.
func (*Select) Loader ¶
Loader loads the options asynchronously: the field shows a loading row until the loader's OptionsMsg arrives, then preselects its default. The loader runs as a command from the form's Init, off the update loop, so a slow loader never delays the first frame.
func (*Select) NaturalSize ¶
func (*Select) OnChange ¶
OnChange works as Text.OnChange. It also runs when an OptionsMsg changes the value, so a field derived from this one follows the loaded default.
func (*Select) Pending ¶
Pending shows the loading row until the caller sends an OptionsMsg for this Select, for callers that start loading on their own schedule.
func (*Select) Rows ¶
Rows fixes the number of visible option rows: more options scroll, fewer leave blank rows. Without it the field shows every option, or reserves four rows while a Loader runs.
func (*Select) SetOptions ¶
SetOptions replaces the options, typically from another field's OnChange. The chosen value is kept when the new options still have it; otherwise the cursor is clamped into the new list. It does not run OnChange, so two fields deriving each other's options cannot loop.
type Tabs ¶ added in v0.3.0
type Tabs struct {
// contains filtered or unexported fields
}
Tabs is a one-row tab strip: each label is padded by a space either side, the active one is drawn bold on Selection and the others Muted on the strip's background (Surface by default). Like Pane it is a pure render value with no Init; the caller owns which tab is active.
func NewTabs ¶ added in v0.3.0
NewTabs returns a strip of labels in theme t with index active selected. An out-of-range active selects nothing.
func (Tabs) OnPanel ¶ added in v0.3.0
OnPanel draws the strip on the theme's Panel instead of Surface, for a strip that sits inside a Pane.
type Text ¶
type Text struct {
// contains filtered or unexported fields
}
func NewText ¶
NewText returns a one-line input whose value is stored under key in the form's Values, titled label.
func (*Text) NaturalSize ¶
func (*Text) OnChange ¶
OnChange sets a hook run whenever the value changes through user input. The returned command, if any, is run by the form.
func (*Text) Placeholder ¶
Placeholder sets the Muted text shown while the input is empty.
type TextArea ¶
type TextArea struct {
// contains filtered or unexported fields
}
TextArea is a multi-line input on bubbles' textarea. Enter moves to the next field like every other field does, so a newline is alt+enter or ctrl+j, the keys huh's text field uses.
func NewTextArea ¶
NewTextArea returns a multi-line input showing three lines.
func (*TextArea) NaturalSize ¶
func (*TextArea) Placeholder ¶
Placeholder sets the Muted text shown while the input is empty.