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

ComponentUse it forPublic APICurrent path
ButtonPrimary, secondary, danger, and ghost actions.ButtonPropspkg/ui
LinkButtonAnchor-like actions styled as buttons.LinkButtonPropspkg/ui
IconStandalone SVG symbols from the shared icon catalog or audited path data.IconPropspkg/ui
IconButtonCompact icon-only or icon-leading actions.IconButtonPropspkg/ui
EventBarDense rows of action controls inside headers or panels.EventBarPropspkg/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>