Bus UI Surface Components

Bounded content blocks for dashboards and detail views.

Use surface components when the screen needs a clear container around content, metrics, or compact summaries. These validated helpers are already available through the public pkg/ui facade and compose typed gx.Node trees before render.

Validated APIs

ComponentUse it forPublic APICurrent path
PanelGeneric titled work surfaces with optional actions and footers.Panel / PanelPropspkg/ui
SurfaceCardCompact grouped content cards with validated body slots.SurfaceCard / SurfaceCardPropspkg/ui
MetricCardHeadline numbers with semantic status accents and detail text.MetricCard / MetricCardPropspkg/ui

Example

The node-first helper is useful when the module wants the surface contract verified before render and still wants to compose with typed Go nodes.

Go API

import (
  gx "github.com/busdk/bus-gx/pkg/gx"
  ui "github.com/busdk/bus-ui/pkg/ui"
)

node := ui.Panel(ui.PanelProps{
  Title: "Monthly close",
  BodyNodes: []gx.Node{
    gx.Element("p", nil, gx.Text("3 statements ready")),
  },
})

html, err := gx.RenderHTML(node)

In .gx source, direct node-returning helpers work well behind a small package-scope wrapper.

In .gx source, surfaces are composed as cards, panels, and metric regions in the markup tree.

.gx source

package surfaceui

import gx "github.com/busdk/bus-gx/pkg/gx"

type SurfaceOverviewProps struct {
  Title string
}

func SurfaceOverview(props SurfaceOverviewProps) gx.Node {
  return <section class="surface-overview">
  <article class="surface-card"><h2><Text value={props.Title}></Text></h2></article>
</section>
}

var surfaces = <SurfaceOverview title={"Evidence summary"}></SurfaceOverview>