EmptyState
States
Section titled “States”A common pattern is to swap between EmptyState variants based on async load status:
// Loadingempty.SetIcon("").SetTitle("Loading...").SetMessage("")
// Loaded but emptyempty.SetIcon(" ").SetTitle("No results").SetMessage("Try a different filter")
// Errorempty.SetIcon(" ").SetTitle("Failed to load").SetMessage(err.Error())
Usage
empty := components.NewEmptyState(). SetIcon(""). SetTitle("No workflows"). SetMessage("Create a workflow to get started")
fmt.Println(empty != nil)Methods
| Method | Signature | Description |
|---|---|---|
Configure | func (e *EmptyState) Configure(icon, title, message string) *EmptyState | Configure sets all fields at once. |
SetIcon | func (e *EmptyState) SetIcon(icon string) *EmptyState | SetIcon sets the icon (Nerd Font glyph). |
SetMessage | func (e *EmptyState) SetMessage(message string) *EmptyState | SetMessage sets the secondary message text. |
SetTitle | func (e *EmptyState) SetTitle(title string) *EmptyState | SetTitle sets the main title text. |