Skip to content
ForgeCastDocs

Interface elements

The building blocks of every window, Dashboard section, settings panel and dialog.

Elements are described, not drawn: you call a constructor like ui.column{ … }, put the children inside the braces and the properties next to them, and give the result to window:render, section:render, ui.modal or plugin.settings. See Build an interface for how they fit together, and UiProps for every property in one place.

Functions

ui.column(props)

Lay children out top to bottom.

Returns UiNode

ui.row(props)

Lay children out left to right.

Returns UiNode

ui.card(props)

A box with an optional title.

Returns UiNode

ui.scroll(props)

A scrolling area (set max_height).

Returns UiNode

ui.divider(props)

A thin line between things.

Returns UiNode

ui.spacer(props)

Empty space that grows, to push what follows to the end of a row or column.

Returns UiNode

ui.text(text, props)

Text: ui.text("hi") or ui.text{ text = "hi", muted = true }.

  • text: string|UiProps
  • props: UiProps, optional

Returns UiNode

ui.heading(text, props)

A heading. level is 1 (largest) to 3.

  • text: string|UiProps
  • props: UiProps, optional

Returns UiNode

ui.badge(props)

A small coloured label; tone picks the colour.

Returns UiNode

ui.code(props)

A block of fixed-width text.

Returns UiNode

A link that opens in the browser (https only).

Name

Type

Returns UiNode

ui.image(props)

A picture from an https address.

Returns UiNode

ui.progress(props)

A bar showing value, from 0 to 1.

Returns UiNode

ui.button(label, on_click, props)

A button: ui.button("Add", function(ev) … end) or ui.button{ label = "Add", on_click = …, variant = "primary" }.

Name

Type

Returns UiNode

ui.input(props)

A text box. Give it a name to read it in ev.values.

Returns UiNode

ui.textarea(props)

A box for several lines of text.

Returns UiNode

ui.checkbox(props)

A tick box.

Returns UiNode

ui.switch(props)

An on/off switch.

Returns UiNode

ui.select(props)

A drop-down list of options.

Returns UiNode

ui.slider(props)

A slider between min and max.

Returns UiNode

ui.table(props)

A table: columns = { "Name", "Count" }, rows = { { "Ann", 3 }, { "Bob", 5 } }.

Returns UiNode

ui.list(props)

Children with a line between them.

Returns UiNode

ui.chat(props)

Chat messages drawn like the Dashboard's chat: ui.chat{ messages = chats.get{ limit = 20 } }.

Returns UiNode

Types

Open a type to see its fields; type names above link here.

On this page