Bus UI Status
EmptyState explains missing content.
Use EmptyState when a collection or detail view has no content and can optionally offer a recovery action.
Public API
| Function | ui.EmptyState |
|---|---|
| Props | ui.EmptyStateProps |
| Use for | Visible absence states with optional action controls. |
Example
Loading EmptyState demo...
Go API
import (
gx "github.com/busdk/bus-gx/pkg/gx"
ui "github.com/busdk/bus-ui/pkg/ui"
)
node, err := ui.EmptyState(ui.EmptyStateProps{
Title: "No files yet",
EventLabel: "Upload file",
Event: ui.ControlProps{Action: "upload-file"},
})
html, err := gx.RenderHTML(node)
In .gx source, wrap the empty-state helper so the
event control stays in Go and the readable text stays in markup.
In .gx source, the empty state is regular section markup with a headline and supporting copy.
.gx source
package statusui
import gx "github.com/busdk/bus-gx/pkg/gx"
type EmptyFilesProps struct {
Title string
}
func EmptyFiles(props EmptyFilesProps) gx.Node {
return <section class="empty-state">
<h2><Text value={props.Title}></Text></h2>
<p><Text value={"Upload evidence to begin."}></Text></p>
</section>
}
var empty = <EmptyFiles title={"No files yet"}></EmptyFiles>