Bus UI Forms

Inputs with explicit boundaries.

Form primitives keep labels, validation text, disabled states, file selection, and submit feedback consistent while the owning module decides routes and policy. The preferred API composes typed gx.Node trees through the public package shown here.

Form pieces

PieceUse it forNames
Form and fieldMethod, action, field label, help text, and errors.FormProps, FieldProps
InputTyped native input controls.InputProps
TextInputSingle-line text entry.TextInputProps
PasswordInputSecret entry without echoing existing values.checked helper arguments
DateInputBrowser-native dates in YYYY-MM-DD form.checked helper arguments
Text area and selectMultiline text and choice controls.TextAreaProps, SelectProps
Submit control and filter toolbarPending states, submit buttons, filters, and reset actions.SubmitControlProps, FilterToolbarProps
File input and drop zoneUpload controls and drag/drop affordances.FileInputProps, DropZoneProps
Credential login cardUsername and password sign-in cards.CredentialLoginCardProps

Where to start

Use the form page when you need native submit wiring, the field page when you need a labeled control wrapper, the single input pages for focused controls, and the upload pages when the module owns file intake or drag-and-drop policy. The public package is on pkg/ui.

See also Evidence and files and Reference.

Example

Compose the form from typed child nodes. The node API keeps labels, controls, and validation explicit without falling back to raw HTML slots.

Go API

import (
  gx "github.com/busdk/bus-gx/pkg/gx"
)

formNodes := []gx.Node{
  gx.Element("label", gx.Props{"for": "description"}, gx.Text("Description")),
  gx.Element("input", gx.Props{
    "id":    "description",
    "name":  "description",
    "value": "Bank statement",
    "type":  "text",
  }),
  gx.Element("button", gx.Props{"type": "submit"}, gx.Text("Upload")),
}

.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 FormExample() gx.Node {
  return <form method="post" action="/upload">
  <label for="description"><Text value={"Description"}></Text></label>
  <input id="description" name="description" type="text"></input>
  <button type="submit"><Text value={"Upload"}></Text></button>
</form>
}

Compose the shared form as a node tree and render at the page boundary.