Bus UI Shell Components

Frames for whole pages and whole modules.

Use shell components when a page needs stable chrome around a module view. These helpers export through pkg/ui, shell slots are typed gx.Node trees, and HTML is produced by explicit render-boundary helpers.

Public APIs

ComponentUse it forPublic APICurrent path
AppShellFull document chrome with title, head assets, nav, main, and footer slots.AppShellPropspkg/ui
PageShellIn-document header, main, and footer structure.PageShellPropspkg/ui
SidebarShellLeft-rail layouts with a nav rail and main content.SidebarShellPropspkg/ui
SidebarNavCollapsible app navigation rails with active item support.SidebarNavPropspkg/ui
SplitLayoutTwo-pane or workspace split layouts with typed pane slots and resize state.SplitLayoutPropspkg/ui
ShellActionPanelBounded shell panels with a title, body, actions, and footer.ShellActionPanelPropspkg/ui

Example

Choose the page-shell helper when a module already owns the browser document and only needs a predictable page frame inside it. The page shell composes header, main, and footer node trees before render; the node-first name remains the validation boundary.

Go API

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

node, err := ui.PageShell(ui.PageShellProps{
  HeaderNodes: []gx.Node{
    gx.Element("h1", nil, gx.Text("Accounting")),
  },
  MainNodes: []gx.Node{
    gx.Element("section", nil, gx.Text("Module overview")),
  },
  FooterNodes: []gx.Node{
    gx.Element("small", nil, gx.Text("Synced now")),
  },
})

html, err := gx.RenderHTML(node)

In .gx source, wrap the page-shell helper before using it from markup and surface any helper error as text.

In .gx source, shell examples are nested page structure: navigation, main content, and supporting regions.

.gx source

package shellui

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

type ShellPreviewProps struct {
  Title string
}

func ShellPreview(props ShellPreviewProps) gx.Node {
  return <section class="shell-preview">
  <nav aria-label="Shell sections"><a href="page-shell/index.html"><Text value={"Page shell"}></Text></a></nav>
  <main><h2><Text value={props.Title}></Text></h2></main>
</section>
}

var shell = <ShellPreview title={"Accounting workspace"}></ShellPreview>