Bus UI File Input
A safe file picker input for upload flows.
Use the file input helper when a module needs a controlled native file picker and wants the node-first surface to own the accept, multiple, and accessibility wiring.
Public surface
| Function | Props type | Import path |
|---|---|---|
FileInput | FileInputProps | github.com/busdk/bus-ui/pkg/ui |
When to use it
Use FileInput when the host module wants a plain file input
without adding drag-and-drop policy. The public API is pkg/ui.
See also Drop zone, Evidence and files, and Reference.
Example
Loading FileInput demo...
Go API
import (
gx "github.com/busdk/bus-gx/pkg/gx"
ui "github.com/busdk/bus-ui/pkg/ui"
)
node, err := ui.FileInput(ui.FileInputProps{
Name: "attachment",
AcceptedTypes: []string{"application/pdf", "image/png"},
Multiple: true,
})
if err != nil {
return err
}
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 FileInputExample() gx.Node {
return <label class="field" for="description">
<Text value={"Description"}></Text>
<input id="description" name="description" type="text"></input>
</label>
}