Path input also File path, Folder picker
A field for a path on disk: a file to open, a folder, or where to save. In a std/ui window (with ray-elements/core/raylang.js) a Browse… button opens the system dialog; in a browser it is a plain text field. Everything else is ray-input.
In a raylang app
Browse… shows only in a std/ui window with the native bridge. It opens the system's dialog for the mode, starting in the folder of the current path (save also suggests the current file name). The chosen path fills the field and fires input and change; the program gets it with the form like any other field.
<ray-path-input name="workspace" label="Workspace" mode="folder"></ray-path-input>
<ray-path-input name="export" label="Export to" mode="save" accept=".csv"></ray-path-input>
// The program's side: ui.events() through bridge.handle, then the form arrives as usual.
for e in ui.events() {
if (bridge.handle(e)) {
continue;
}
if (e.kind == "message" && e.tag.starts_with("settings:")) {
save_settings(e.tag.substring(9, e.tag.len()))?;
}
}API
For AI agents: this API as Markdown, or every component in llms-full.txt.
<ray-path-input> · RayPathInput
Browse… shows only with a native host that offers pick_path (see core/host.js); the dialog starts in the folder of the current path. The path can always be typed or pasted.
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
mode | mode reflects | open | folder | save | open | What the dialog chooses: an existing file, a folder, or a file to save (the current name is suggested). |
accept | accept reflects | string | File types the dialog offers, as in <input type=file>: ".json,.toml", "image/*" (ignored for folders). | |
browseLabel | browse-label | string | Browse… (text path-input.browse) | Text of the button. |
dialogTitle | dialog-title | string | Title of the system dialog (default: the label). |
| Event | Description |
|---|---|
change | The path changed: typed and committed, or chosen in the dialog. |
ray-error | The system dialog failed. |
| Part | Description |
|---|---|
browse | The Browse… button. |
Texts
What it writes itself, in English; setStrings() translates them (Getting started: Languages).
| Key | English |
|---|---|
path-input.browse | Browse… |