Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CustomAction ¶ added in v0.16.0
type CustomAction[T any] struct { // Key is the key that the user should press to select this action. Key string // Description is a short description of what this action does, used in help // text. // // For example, in the help text "o to open.", "to open" is the description. Description string // Do is the function to call when the user presses the key for this action. Do func(selected T) tea.Cmd }
type ErrMsg ¶ added in v0.16.0
type ErrMsg error
ErrMsg is a tea.Msg that indicates an error occurred during the picker's lifecycle.
type Model ¶
type Model[T any] struct { // Error is the error that occurred during the picker's lifecycle, if any. Error error // contains filtered or unexported fields }
func New ¶
New returns a new picker model. The render function is used to render each item in the list.
type Options ¶ added in v0.16.0
type Options[T any] struct { // Items is the list of items to display, from which the user can pick. Items []T // MessageForZeroItems is the message to display when there are no items to // list. MessageForZeroItems string // ItemRenderFunc is the function to use to render each item in the list. If // nil, the item will be rendered via fmt.Sprintf("%v", item). ItemRenderFunc func(T) string // CustomActions is a list of custom actions that the user can take. CustomActions []CustomAction[T] }
Click to show internal directories.
Click to hide internal directories.