Bus UI Surfaces
Panel renders bounded work surfaces.
Use Panel for a titled surface with typed body nodes, optional actions, and validated attributes.
Public API
| Function | ui.Panel |
|---|---|
| Props | ui.PanelProps |
| Use for | Generic titled work surfaces with optional action and footer regions. |
Example
Loading Panel demo...
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 can be
wrapped without an error branch.
In .gx source, a panel is a section of markup with a heading and nested content.
.gx source
package surfaceui
import gx "github.com/busdk/bus-gx/pkg/gx"
type ReviewPanelProps struct {
Title string
}
func ReviewPanel(props ReviewPanelProps) gx.Node {
return <section class="panel">
<h2><Text value={props.Title}></Text></h2>
<p><Text value={"Check imported rows before posting."}></Text></p>
</section>
}
var panel = <ReviewPanel title={"Review import"}></ReviewPanel>