Bus UI Evidence And Files
ImageGallery keeps media sets allowlisted.
Use it when a gallery should accept only same-origin or allowlisted HTTPS images and report rejected items without hiding why they were dropped.
Public API
ImageGallery(p ImageGalleryProps) (ImageGalleryResult, error)
The input model is ImageGalleryProps with ImageGalleryItem
entries and an allowlist of image origins. The result includes rendered HTML,
accepted items, and ImageGalleryDiagnostic entries.
When to use it
Use ImageGallery for document previews, uploaded proof sets, or any
gallery that needs URL safety checks before images are shown.
Live demo
Example
Go API
import (
gx "github.com/busdk/bus-gx/pkg/gx"
ui "github.com/busdk/bus-ui/pkg/ui"
)
node := ui.ImageGallery(ui.ImageGalleryProps{
ImageOrigins: []string{"https://files.example.com"},
Items: []ui.ImageGalleryItem{
{
Src: "https://files.example.com/evidence/photo-1.jpg",
Alt: "Receipt on a desk",
Href: "https://files.example.com/evidence/photo-1.jpg",
},
},
})
html, err := gx.RenderHTML(node)
.gx source
In .gx source, author the visible component state as GX markup.
Keep the Go API block above for the package helper or render-boundary call.
package busuiexamples
import gx "github.com/busdk/bus-gx/pkg/gx"
func ImageGalleryExample() gx.Node {
return <section class="image-gallery">
<figure><img alt="Receipt page" src="/evidence/receipt.png"></img></figure>
</section>
}
Use the public pkg/ui facade for this image gallery surface.