Bus UI Actions
LinkButton styles navigation like an action.
Use LinkButton when the target is a safe link or download but the visual treatment should match shared buttons.
Public API
| Function | ui.LinkButton |
|---|---|
| Props | ui.LinkButtonProps |
| Render boundary | Render the returned node with gx.RenderHTML when HTML is needed. |
| Use for | Anchor-like actions styled consistently with buttons. |
Example
Loading LinkButton demo...
Go API
import (
gx "github.com/busdk/bus-gx/pkg/gx"
ui "github.com/busdk/bus-ui/pkg/ui"
)
node, err := ui.LinkButton(ui.LinkButtonProps{
Label: "Download report",
Href: "report/index.html",
})
if err != nil {
return err
}
html, err := gx.RenderHTML(node)
In .gx source, keep the public helper behind a
package-scope component wrapper and use lower-camel source attributes.
In .gx source, the linked action is ordinary anchor markup with component props flowing through lower-camel attributes.
.gx source
package actionsui
import gx "github.com/busdk/bus-gx/pkg/gx"
type EvidenceLinkButtonProps struct {
Label string
Href string
}
func EvidenceLinkButton(props EvidenceLinkButtonProps) gx.Node {
return <a class="button button-link" href={props.Href}>
<Text value={props.Label}></Text>
</a>
}
var evidenceLink = <EvidenceLinkButton label={"Open evidence"} href={"/evidence/receipt.html"}></EvidenceLinkButton>