Bus UI Action Components
Buttons and action bars with consistent control semantics.
Use action components for the visible controls that move a screen forward. The
public package exposes typed gx.Node helpers for buttons, links, icon
actions, and event bars, with explicit HTML rendering only at the boundary.
Public APIs
| Component | Use it for | Public API | Current path |
|---|---|---|---|
| Button | Primary, secondary, danger, and ghost actions. | ButtonProps | pkg/ui |
| LinkButton | Anchor-like actions styled as buttons. | LinkButtonProps | pkg/ui |
| Icon | Standalone SVG symbols from the shared icon catalog or audited path data. | IconProps | pkg/ui |
| IconButton | Compact icon-only or icon-leading actions. | IconButtonProps | pkg/ui |
| EventBar | Dense rows of action controls inside headers or panels. | EventBarProps | pkg/ui |
Example
The public package can already render the common button shape. When a module only needs a labelled action, the wrapper is the simplest entry point.
Go API
import (
gx "github.com/busdk/bus-gx/pkg/gx"
ui "github.com/busdk/bus-ui/pkg/ui"
)
node, err := ui.Button(ui.ButtonProps{
Label: "Save draft",
Variant: ui.ButtonPrimary,
})
if err != nil {
return err
}
html, err := gx.RenderHTML(node)
In .gx source, compose action controls directly as markup and keep the Go helper call in the API example.
.gx source
package actionsui
import gx "github.com/busdk/bus-gx/pkg/gx"
type ActionRowProps struct {
Label string
Href string
}
func ActionRow(props ActionRowProps) gx.Node {
return <section class="action-row">
<button class="button button-primary" type="button"><Text value={props.Label}></Text></button>
<a class="button button-link" href={props.Href}><Text value={"View evidence"}></Text></a>
</section>
}
var row = <ActionRow label={"Save draft"} href={"/evidence/index.html"}></ActionRow>