Bus UI Surfaces
SurfaceCard frames repeated content.
Use SurfaceCard for compact grouped content where each repeated item needs the same validated surface treatment.
Public API
| Function | ui.SurfaceCard |
|---|---|
| Props | ui.SurfaceCardProps |
| Use for | Repeated or grouped cards with validated typed body slots. |
Example
Loading SurfaceCard demo...
Go API
import (
gx "github.com/busdk/bus-gx/pkg/gx"
ui "github.com/busdk/bus-ui/pkg/ui"
)
node := ui.SurfaceCard(ui.SurfaceCardProps{
HeaderNodes: []gx.Node{
gx.Element("strong", nil, gx.Text("Bank file")),
},
BodyNodes: []gx.Node{
gx.Element("p", nil, gx.Text("Imported successfully")),
},
})
html, err := gx.RenderHTML(node)
In .gx source, use a direct wrapper for
gx.Node-returning surface helpers.
In .gx source, a surface card is authored as an article with its title and body in markup.
.gx source
package surfaceui
import gx "github.com/busdk/bus-gx/pkg/gx"
type EvidenceCardProps struct {
Title string
}
func EvidenceCard(props EvidenceCardProps) gx.Node {
return <article class="surface-card">
<h2><Text value={props.Title}></Text></h2>
<p><Text value={"Receipt image and metadata are ready."}></Text></p>
</article>
}
var card = <EvidenceCard title={"Receipt evidence"}></EvidenceCard>