KeyHintBar
Usage
bar := components.NewKeyHintBar(). SetHints([]components.KeyHint{ {Key: "Enter", Description: "Select"}, {Key: "j/k", Description: "Navigate"}, {Key: "Esc", Description: "Back"}, })
fmt.Println(bar != nil)Methods
| Method | Signature | Description |
|---|---|---|
AddHint | func (k *KeyHintBar) AddHint(key, description string) *KeyHintBar | AddHint adds a single hint. |
Clear | func (k *KeyHintBar) Clear() *KeyHintBar | Clear removes all hints. |
GetPreferredHeight | func (k *KeyHintBar) GetPreferredHeight() int | GetPreferredHeight returns the preferred height for the hint bar. |
SetHints | func (k *KeyHintBar) SetHints(hints []KeyHint) *KeyHintBar | SetHints sets the hints to display. |
Types
type KeyHint struct KeyHint represents a single key binding hint. | Field | Type | Description |
|---|---|---|
Key | string | e.g., "Enter", "Esc", "Space", "j/k" |
Description | string | e.g., "Select", "Close", "Toggle" |