Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Selection ¶
type Selection[E any] struct { // contains filtered or unexported fields }
Selection represents a selectable list of options with corresponding values. A user can use the Up- and Down-cursor keys to select an option, and push Enter to confirm the selection.
By default, the `ascii` theme is used, but a Nerd Font theme `nerdfont` is also available.
func NewSelection ¶
func (*Selection[E]) RenderWithTheme ¶
RenderWithTheme renders the Selection with the specified theme. If the theme with the given name does not exist, the default theme of the Selection is used.
func (*Selection[E]) Selected ¶
func (s *Selection[E]) Selected() E
Selected returns the currently selected option from the Selection.
func (*Selection[E]) SetShowing ¶
SetShowing sets the number of options to be shown in the selection. If n is less than 1, it sets the number of options to the terminal height minus 3. Otherwise, it sets the number of options to n.