Przejdź do treści

UI Controls

The complete ui.* control catalog — signatures, options, handle properties, and runnable examples

7 min czytaniaTen poradnik jest dostępny tylko po angielsku.
Na tej stronie

Every control is one ui.* call. Each call returns a handle (a chart returns a slightly different handle — see Charts). Reading and writing a handle's .value, and flipping .disabled, .hidden, or .label, updates the panel live at any time — not just while the run is happening.

Every control also accepts align: "start" | "center" | "end" in its options, placing it within the panel's width.

Reference table

ControlKindPersists across Run
ui.titleText and structure—
ui.textText and structure—
ui.dividerText and structure—
ui.cardLayout container—
ui.rowLayout container—
ui.tabsLayout containerYes (selected tab)
ui.buttonInput—
ui.sliderInputYes
ui.numberInputYes
ui.inputInputYes
ui.toggleInputYes
ui.selectInputYes
ui.colorInputYes
ui.swatchesInputYes
ui.readoutOutputNo (script-driven)
ui.statOutputNo (script-driven)
ui.progressOutputNo (script-driven)
ui.chartOutputNo (script-driven)
ui.tableOutputNo (script-driven)
ui.badgeOutputNo (script-driven)
ui.alertOutputNo (script-driven)
ui.codeOutputNo (script-driven)
ui.spinnerOutputNo (script-driven)
ui.layoutPanel-wide—

"Persists across Run" means: when the panel is user-edited (a slider you dragged, text you typed), pressing Run to apply a code change keeps that value instead of resetting it — matched by the control's kind and label. Script-driven outputs always start from whatever your code sets them to on the new run.

Title, text, divider

ui.title("My App")
ui.text("A line of description.")
ui.text("Muted helper text.", { muted: true })
ui.divider()
CallOptionsNotes
ui.title(text, opts?){ align? }A heading for the panel or a section.
ui.text(text, opts?){ muted?, align? }A line of description; muted: true dims it.
ui.divider(opts?){ align? }A horizontal rule to separate groups.

Panel layout (ui.layout)

Not a control — sets options for the whole panel, not one control. Call it once, anywhere in your script.

ui.layout({ align: "center", maxWidth: 460 })
// or, to use the full available width:
ui.layout({ maxWidth: "full" })

ui.layout({ align?, maxWidth? })

  • align: "start" | "center" | "end" — the default alignment for controls that don't set their own.
  • maxWidth: a pixel width for the panel, or "full" to remove the cap.

Wczytywanie indeksu…

↑↓wybierz↵otwórzesczamknij