Modules · Interface · Ui

Ui

Buttons, layout, forms and the rest of the interface toolkit. Ui is a reactive component library: every function emits a piece of the interface into an enclosing tree, and most container components take a block of nested content built from more Ui calls. It spans layout (Ui.Layout.Column, Ui.Layout.Grid), content and inputs, buttons that write directly to state, overlays and popups, a full form and validation system, and a theming model. Component names are sub-namespaced — Ui.Content.Text, Ui.Button.Integer.Increment — grouping related pieces.

Contents

Types

Functions

Types

Ui.Component.Data

A single UI component: a component name plus its attributes map, the generic node every Ui component emits.

Fields

FieldTypeDescription
componentNameTextThe component kind, e.g. UiContentText or UiLayoutColumn.
attributesCollection.Map(Code.Language.Json.Value)The component's attributes, keyed by name.

Ui.Form.FieldResult

The result for one form field: its previous value and any validation error.

Fields

FieldTypeDescription
optionalPreviousValueCollection.Optional(Text)The value last entered, if any.
optionalErrorCollection.Optional(Text)The validation error for the field, if any.

Ui.Form.Result

The outcome of a form: a status, a message, optional per-field results and an optional error code.

Fields

FieldTypeDescription
statusTypeTextOne of success, error, pending or empty.
statusMessageTextMessage shown to the user.
optionalFieldsCollection.Optional(Collection.Map(Ui.Form.FieldResult))Per-field results, keyed by field name.
optionalErrorCodeCollection.Optional(Text)Machine-readable error code, if any.

Ui.Overlay.Item

One item bound for a named overlay container: its target name and its content tree.

Fields

FieldTypeDescription
nameTextThe target container name, e.g. UiLoading or UiPopup.
treeCollection.Tree(Ui.Component.Data)The overlay item's content tree.

Ui.Theme.BackgroundStyle

A background style: gradient fill, border radius, colour and width, and inner padding.

Fields

FieldTypeDescription
backgroundGradientUi.Theme.GradientThe fill gradient.
borderRadiusMaths.RealCorner radius in pixels.
borderColourColourBorder colour.
borderSizeMaths.RealBorder width in pixels.
paddingMaths.RealInner padding in pixels.

Ui.Theme.Button

The styling for a button: its label text style and its background style.

Fields

FieldTypeDescription
textUi.Theme.TextStyleText style for the label.
backgroundUi.Theme.BackgroundStyleBackground style for the button.

Ui.Theme.Data

A complete theme: named variants, a default variant and optional nested-title styling.

Fields

FieldTypeDescription
nameTextThe theme name, e.g. light or dark.
variantsCollection.Map(Ui.Theme.Variant)Variant name to variant styling.
defaultVariantNameTextThe variant used when none is selected.
optionalContentTitleNestedFontCollection.Optional(Text)Font for deeply nested titles.
optionalContentTitleNestedPanelGradientCollection.Optional(Ui.Theme.Gradient)Gradient for nested titles under a panel.
optionalContentTitleNestedMainGradientCollection.Optional(Ui.Theme.Gradient)Gradient for nested titles under a section.

Ui.Theme.Gradient

A colour gradient: a primary colour and an optional second colour for a two-stop blend.

Fields

FieldTypeDescription
colour1ColourThe primary colour.
optionalColour2Collection.Optional(Colour)The second colour, or none for a solid fill.

Ui.Theme.InputStyle

The styling for a form input across normal and error states, plus label, error text and spacing.

Fields

FieldTypeDescription
labelTextStyleUi.Theme.TextStyleStyle for the field label.
fieldTextStyleUi.Theme.TextStyleField value style, normal state.
fieldBackgroundStyleUi.Theme.BackgroundStyleField background, normal state.
fieldErrorTextStyleUi.Theme.TextStyleField value style, error state.
fieldErrorBackgroundStyleUi.Theme.BackgroundStyleField background, error state.
errorTextStyleUi.Theme.TextStyleStyle for the error message.
spacingMaths.RealVertical spacing between parts.

Ui.Theme.Style

A paired text and background style.

Fields

FieldTypeDescription
textUi.Theme.TextStyleText styling.
backgroundUi.Theme.BackgroundStyleBackground styling.

Ui.Theme.TextStyle

A text style: colour gradient, font, size and the bold, italic, underline, caps and alignment flags.

Fields

FieldTypeDescription
gradientUi.Theme.GradientText colour gradient.
fontTextFont family name.
sizeMaths.RealFont size in pixels.
allCapsLogic.MaybeWhether text is uppercased.
underlineLogic.MaybeWhether text is underlined.
boldLogic.MaybeWhether text is bold.
italicLogic.MaybeWhether text is italic.
alignmentTextAlignment: left, center or right.

Ui.Theme.Variant

One theme variant: title and body text styles, child variant names, a background and spacing.

Fields

FieldTypeDescription
titleStyleUi.Theme.TextStyleText style for titles and headings.
textStyleUi.Theme.TextStyleText style for body text.
variantNamesCollection.Map(Collection.Optional(Text))Child component keys to variant names.
optionalBackgroundStyleCollection.Optional(Ui.Theme.BackgroundStyle)Background styling, or none.
spacingMaths.RealSpacing between child elements, in pixels.

Functions

Ui.Active.Disable

Marks its block disabled when the flag is yes.

Parameters

NameTypeDescription
disabledFlagLogic.MaybeWhen yes, descendants are disabled.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Active.Enable

Marks its block enabled when the flag is yes.

Parameters

NameTypeDescription
enabledFlagLogic.MaybeWhen yes, descendants are enabled.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Active.IsDisabled

Whether the surrounding region is currently disabled.

Returns

Returns Logic.Maybe — yes when the enclosing region is disabled.

Ui.Active.IsEnabled

Whether the surrounding region is currently enabled.

Returns

Returns Logic.Maybe — yes when the enclosing region is enabled.

Ui.Attribute

Adds a named attribute to the component currently being built.

Parameters

NameTypeDescription
nameTextAttribute name.
valueCode.Language.Json.ValueAttribute value.

Returns

Returns nothing — records one attribute on the enclosing Ui.Component.

Ui.Button.Array.Insert

A button that inserts a value at an index of an array state.

Parameters

NameTypeDescription
arraySettableCode.Language.Json.ValueThe array state to update.
insertIndexMaths.IntegerIndex to insert at.
insertValueCode.Language.Json.ValueThe value to insert.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Array.Pop

A button that removes the last element of an array state.

Parameters

NameTypeDescription
arraySettableCode.Language.Json.ValueThe array state to update.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Array.Push

A button that appends a value to an array state.

Parameters

NameTypeDescription
arraySettableCode.Language.Json.ValueThe array state to update.
pushValueCode.Language.Json.ValueThe value to append.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Array.Remove

A button that removes the element at an index of an array state.

Parameters

NameTypeDescription
arraySettableCode.Language.Json.ValueThe array state to update.
removeIndexMaths.IntegerIndex to remove.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Array.Swap

A button that swaps two elements of an array state.

Parameters

NameTypeDescription
arraySettableCode.Language.Json.ValueThe array state to update.
indexMaths.IntegerFirst index.
withIndexMaths.IntegerSecond index.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Boolean.False

A button that sets a boolean state to no.

Parameters

NameTypeDescription
settableLogic.MaybeThe boolean state to set.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Boolean.Toggle

A button that flips a boolean state between yes and no.

Parameters

NameTypeDescription
settableLogic.MaybeThe boolean state to toggle.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Boolean.True

A button that sets a boolean state to yes.

Parameters

NameTypeDescription
settableLogic.MaybeThe boolean state to set.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Disabled

A permanently disabled button.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Integer.Add

A button that adds an amount to an integer state.

Parameters

NameTypeDescription
settableMaths.IntegerThe integer state to update.
amountMaths.IntegerThe amount to add.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Integer.Decrement

A button that subtracts one from an integer state.

Parameters

NameTypeDescription
settableMaths.IntegerThe integer state to decrement.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Integer.Increment

A button that adds one to an integer state.

Parameters

NameTypeDescription
settableMaths.IntegerThe integer state to increment.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Example

Ui.Button.Integer.Increment count
Ui.Content.Text "+"
A button that increments count on press.

Ui.Button.Integer.Subtract

A button that subtracts an amount from an integer state.

Parameters

NameTypeDescription
settableMaths.IntegerThe integer state to update.
amountMaths.IntegerThe amount to subtract.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Real.Add

A button that adds an amount to a real state.

Parameters

NameTypeDescription
settableMaths.RealThe real state to update.
amountMaths.RealThe amount to add.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Real.Subtract

A button that subtracts an amount from a real state.

Parameters

NameTypeDescription
settableMaths.RealThe real state to update.
amountMaths.RealThe amount to subtract.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Button.Value.Setter

A button that sets a state cell to a value when pressed.

Parameters

NameTypeDescription
settableCode.Language.Json.ValueThe state cell to update on press.
newValueCode.Language.Json.ValueThe value to assign on press.
optionalDisabledCollection.Optional(Logic.Maybe)When yes, the button is disabled.

Block

The button's label content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Example

Ui.Button.Value.Setter mode "dark"
Ui.Content.Text "Dark mode"
A button that sets mode to "dark".

Ui.Click.Setter

Makes its content set a state cell to a value when tapped.

Parameters

NameTypeDescription
settableCode.Language.Json.ValueThe state cell to update on press.
newValueCode.Language.Json.ValueThe value to assign on tap.

Block

The tappable content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Component

Creates and emits a UI component, gathering attributes and children from its block.

Parameters

NameTypeDescription
componentNameTextThe component kind to emit.

Block

The block, where Ui.Attribute calls and child components are gathered.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Content.Area

Wraps its block in a plain content area.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Content.Icon

Shows a named icon inline.

Parameters

NameTypeDescription
iconNameTextThe icon name.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Content.Image

Shows an image at an optional size.

Parameters

NameTypeDescription
pathTextImage path or URL.
optionalWidthCollection.Optional(Maths.Real)Width in pixels, if fixed.
optionalHeightCollection.Optional(Maths.Real)Height in pixels, if fixed.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Content.Panel

Wraps its block in a themed panel container.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Content.Section

Wraps its block in a themed section container.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Content.Text

Shows a run of body text, joining any extra fragments.

Parameters

NameTypeDescription
textTextThe text to show.
optionalText2Collection.Optional(Text)Extra text run 2, if any.
optionalText3Collection.Optional(Text)Extra text run 3, if any.
optionalText4Collection.Optional(Text)Extra text run 4, if any.
optionalText5Collection.Optional(Text)Extra text run 5, if any.
optionalText6Collection.Optional(Text)Extra text run 6, if any.
optionalText7Collection.Optional(Text)Extra text run 7, if any.
optionalText8Collection.Optional(Text)Extra text run 8, if any.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Example

Ui.Content.Text "Hello, world"
Shows a line of text.

Ui.Content.Title

Shows a heading, joining any extra fragments.

Parameters

NameTypeDescription
textTextThe text to show.
optionalText2Collection.Optional(Text)Extra text run 2, if any.
optionalText3Collection.Optional(Text)Extra text run 3, if any.
optionalText4Collection.Optional(Text)Extra text run 4, if any.
optionalText5Collection.Optional(Text)Extra text run 5, if any.
optionalText6Collection.Optional(Text)Extra text run 6, if any.
optionalText7Collection.Optional(Text)Extra text run 7, if any.
optionalText8Collection.Optional(Text)Extra text run 8, if any.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Example

Ui.Content.Title "Settings"
Shows a page title.

Ui.Form

Opens a form bound to a result state, with submission handled by a reverse.

Parameters

NameTypeDescription
formDataStateUi.Form.ResultThe form's result state.
submissionReverseUi.Form.ResultA reverse that receives the submitted result.

Block

Two blocks: the form fields, then the submit content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Example

Ui.Form result onSubmit
Ui.Form.Field.Text "name" "Name"
Ui.Form.Submit "Save"
A one-field form with a submit button.

Ui.Form.Field

A form field with a custom input and validation block.

Parameters

NameTypeDescription
nameTextThe field's name in the form result.
labelTextThe field label.

Block

Two blocks: the input, which receives a valueBinding, then validation, which receives the optionalValue.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Form.Field.Checkbox

A checkbox form field.

Parameters

NameTypeDescription
nameTextThe field's name in the form result.
labelTextThe field label.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Form.Field.Email

A email form field with an optional validation block.

Parameters

NameTypeDescription
nameTextThe field's name in the form result.
labelTextThe field label.

Block

Validation rules for the field, receiving the field's optionalValue.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Form.Field.Hidden

A hidden form field carrying a fixed value.

Parameters

NameTypeDescription
nameTextThe field's name in the form result.
valueTextThe hidden value.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Form.Field.Image

A image form field with an optional validation block.

Parameters

NameTypeDescription
nameTextThe field's name in the form result.
labelTextThe field label.

Block

Validation rules for the field, receiving the field's optionalValue.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Form.Field.Number

A number form field with an optional validation block.

Parameters

NameTypeDescription
nameTextThe field's name in the form result.
labelTextThe field label.

Block

Validation rules for the field, receiving the field's optionalValue.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Form.Field.OptionalNonEmptyString

Treats an empty string as absent, for optional field values.

Parameters

NameTypeDescription
valueTextThe value to normalise.

Returns

Returns Collection.Optional(Text) — the value, or none when it is empty.

Ui.Form.Field.Password

A password form field with an optional validation block.

Parameters

NameTypeDescription
nameTextThe field's name in the form result.
labelTextThe field label.

Block

Validation rules for the field, receiving the field's optionalValue.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Form.Field.PhoneNumber

A phone number form field with an optional validation block.

Parameters

NameTypeDescription
nameTextThe field's name in the form result.
labelTextThe field label.

Block

Validation rules for the field, receiving the field's optionalValue.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Form.Field.ReadOnly

A read-only form field with an optional validation block.

Parameters

NameTypeDescription
nameTextThe field's name in the form result.
labelTextThe field label.

Block

Validation rules for the field, receiving the field's optionalValue.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Form.Field.Text

A text form field with an optional validation block.

Parameters

NameTypeDescription
nameTextThe field's name in the form result.
labelTextThe field label.

Block

Validation rules for the field, receiving the field's optionalValue.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Form.Field.Textarea

A multi-line text form field with an optional validation block.

Parameters

NameTypeDescription
nameTextThe field's name in the form result.
labelTextThe field label.

Block

Validation rules for the field, receiving the field's optionalValue.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Form.Submit

A submit button for the enclosing form.

Parameters

NameTypeDescription
labelTextThe button label.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Form.Validate.Integer.Max

Fails when the value is above a maximum.

Parameters

NameTypeDescription
optionalValueCollection.Optional(Maths.Integer)The value to check.
maxValueMaths.IntegerThe largest allowed value.
errorMessageTextMessage shown on failure.

Returns

Returns nothing — records the error on the field when the check fails.

Ui.Form.Validate.Integer.Min

Fails when the value is below a minimum.

Parameters

NameTypeDescription
optionalValueCollection.Optional(Maths.Integer)The value to check.
minValueMaths.IntegerThe smallest allowed value.
errorMessageTextMessage shown on failure.

Returns

Returns nothing — records the error on the field when the check fails.

Ui.Form.Validate.Integer.Positive

Fails when the value is not positive.

Parameters

NameTypeDescription
optionalValueCollection.Optional(Maths.Integer)The value to check.
errorMessageTextMessage shown on failure.

Returns

Returns nothing — records the error on the field when the check fails.

Ui.Form.Validate.Real.Max

Fails when the value is above a maximum.

Parameters

NameTypeDescription
optionalValueCollection.Optional(Maths.Real)The value to check.
maxValueMaths.RealThe largest allowed value.
errorMessageTextMessage shown on failure.

Returns

Returns nothing — records the error on the field when the check fails.

Ui.Form.Validate.Real.Min

Fails when the value is below a minimum.

Parameters

NameTypeDescription
optionalValueCollection.Optional(Maths.Real)The value to check.
minValueMaths.RealThe smallest allowed value.
errorMessageTextMessage shown on failure.

Returns

Returns nothing — records the error on the field when the check fails.

Ui.Form.Validate.Real.Positive

Fails when the value is not positive.

Parameters

NameTypeDescription
optionalValueCollection.Optional(Maths.Real)The value to check.
errorMessageTextMessage shown on failure.

Returns

Returns nothing — records the error on the field when the check fails.

Ui.Form.Validate.Required

Fails validation when the value is absent or empty.

Parameters

NameTypeDescription
optionalValueCollection.Optional(Text)The value to check.
errorMessageTextMessage shown on failure.

Returns

Returns nothing — records the error on the field when the value is missing.

Ui.Form.Validate.String.ContainsOnly

Fails when the text has characters outside an allowed set.

Parameters

NameTypeDescription
optionalValueCollection.Optional(Text)The value to check.
allowedCharsTextThe allowed characters.
errorMessageTextMessage shown on failure.

Returns

Returns nothing — records the error on the field when the check fails.

Ui.Form.Validate.String.Email

Fails when the text is not a valid email address.

Parameters

NameTypeDescription
optionalValueCollection.Optional(Text)The value to check.
errorMessageTextMessage shown on failure.

Returns

Returns nothing — records the error on the field when the check fails.

Ui.Form.Validate.String.MaxLength

Fails when the text is longer than a maximum length.

Parameters

NameTypeDescription
optionalValueCollection.Optional(Text)The value to check.
maxLengthMaths.IntegerMaximum length.
errorMessageTextMessage shown on failure.

Returns

Returns nothing — records the error on the field when the check fails.

Ui.Form.Validate.String.MinLength

Fails when the text is shorter than a minimum length.

Parameters

NameTypeDescription
optionalValueCollection.Optional(Text)The value to check.
minLengthMaths.IntegerMinimum length.
errorMessageTextMessage shown on failure.

Returns

Returns nothing — records the error on the field when the check fails.

Ui.Form.Validate.String.Pattern

Fails when the text does not match a pattern.

Parameters

NameTypeDescription
optionalValueCollection.Optional(Text)The value to check.
patternTextThe pattern to match.
errorMessageTextMessage shown on failure.

Returns

Returns nothing — records the error on the field when the check fails.

Ui.Icon.Add

Draws the built-in add icon.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Icon.Back

Draws the built-in back icon.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Icon.Blank

Draws the built-in blank icon.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Icon.Close

Draws the built-in close icon.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Icon.Delete

Draws the built-in delete icon.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Icon.Edit

Draws the built-in edit icon.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Icon.Forward

Draws the built-in forward icon.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Icon.Home

Draws the built-in home icon.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Icon.Icon

Draws a named icon.

Parameters

NameTypeDescription
iconNameTextThe icon name.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Icon.Menu

Draws the built-in menu icon.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Icon.Profile

Draws the built-in profile icon.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Icon.Settings

Draws the built-in settings icon.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Input.Checkbox

A checkbox input bound to a text state.

Parameters

NameTypeDescription
valueTextThe state cell the field reads and writes.
optionalPlaceholderCollection.Optional(Text)Placeholder text, if any.
optionalDisabledCollection.Optional(Logic.Maybe)When yes, the input is disabled.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Input.Frame

Wraps its block in the standard input frame styling.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Input.Number

A number input bound to a real state.

Parameters

NameTypeDescription
valueMaths.RealThe real state the field reads and writes.
optionalPlaceholderCollection.Optional(Text)Placeholder text, if any.
optionalDisabledCollection.Optional(Logic.Maybe)When yes, the input is disabled.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Input.Password

A password input bound to a text state.

Parameters

NameTypeDescription
valueTextThe state cell the field reads and writes.
optionalPlaceholderCollection.Optional(Text)Placeholder text, if any.
optionalDisabledCollection.Optional(Logic.Maybe)When yes, the input is disabled.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Input.Text

A text input bound to a text state.

Parameters

NameTypeDescription
valueTextThe state cell the field reads and writes.
optionalPlaceholderCollection.Optional(Text)Placeholder text, if any.
optionalDisabledCollection.Optional(Logic.Maybe)When yes, the input is disabled.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Input.Textarea

A textarea input bound to a text state.

Parameters

NameTypeDescription
valueTextThe state cell the field reads and writes.
optionalPlaceholderCollection.Optional(Text)Placeholder text, if any.
optionalDisabledCollection.Optional(Logic.Maybe)When yes, the input is disabled.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Layout.Column

Lays out its block as a column.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Layout.Grid

Lays out its block as a grid with a fixed column count.

Parameters

NameTypeDescription
columnCountMaths.IntegerNumber of columns.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Layout.Height

Constrains its block to a fixed height.

Parameters

NameTypeDescription
heightMaths.RealHeight in pixels.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Layout.Position

Offsets its block to a position within a stack.

Parameters

NameTypeDescription
xMaths.RealHorizontal offset in pixels.
yMaths.RealVertical offset in pixels.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Layout.Row

Lays out its block as a row.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Layout.Scrollable

Lays out its block as a scrollable.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Layout.Size

Constrains its block to a fixed width and height.

Parameters

NameTypeDescription
widthMaths.RealWidth in pixels.
heightMaths.RealHeight in pixels.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Layout.Stack

Lays out its block as a stack.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Layout.Stretch

Lays out its block as a stretch.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Layout.Width

Constrains its block to a fixed width.

Parameters

NameTypeDescription
widthMaths.RealWidth in pixels.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Loading.Check

Shows the loading overlay while a value is still resolving.

Parameters

NameTypeDescription
valueCode.Language.Json.ValueThe value whose lock state is checked.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Loading.Container

Marks its block as the region a loading overlay covers.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Logic.If

Runs its block only when the condition is yes, keeping lock state for loading.

Parameters

NameTypeDescription
conditionLogic.MaybeThe condition to test.

Block

The content shown when condition is yes.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Example

Ui.Logic.If loggedIn
Ui.Content.Text "Welcome back"
Shows the greeting only when loggedIn is yes.

Ui.Logic.IfNot

Runs its block only when the condition is no.

Parameters

NameTypeDescription
conditionLogic.MaybeThe condition to test.

Block

The content shown when condition is no.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Optional.If

Runs its block with the unwrapped value when the optional is present.

Parameters

NameTypeDescription
optionalValueCollection.Optional(T)The optional value to test.

Block

The content run when the value is present; the block receives the unwrapped value.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Optional.IfNot

Runs its block when the optional is absent.

Parameters

NameTypeDescription
optionalValueCollection.Optional(T)The optional value to test.

Block

The content run when the value is absent.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Overlay.Background

Shows a dimmed overlay backdrop when visible is yes.

Parameters

NameTypeDescription
visibleLogic.MaybeWhen yes, the backdrop is shown.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Overlay.Container

Opens a named overlay container that gathers matching items.

Parameters

NameTypeDescription
nameTextThe container name.

Block

The container's base content; overlay items target it by name.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Overlay.Item

Sends its block to the named overlay container.

Parameters

NameTypeDescription
nameTextThe target container name.

Block

The overlay item content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Overlay.ItemIf

Sends its block to a container only while visible is yes.

Parameters

NameTypeDescription
nameTextThe target container name.
visibleLogic.MaybeWhen yes, the item is shown.

Block

The overlay item content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Popup.Container

Marks its block as the region popups render over.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Popup.ShowIf

Shows a popup dialog while a state is yes.

Parameters

NameTypeDescription
showStateLogic.MaybeWhen yes, the popup is shown.

Block

Two blocks: the popup header, then its body content.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Status.Container

Marks its block as a status region.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Status.Error

Shows its block styled as an error.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Status.ErrorIf

Shows its block styled as an error only when the condition is yes.

Parameters

NameTypeDescription
conditionLogic.MaybeWhen yes, the error is shown.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Status.Note

Shows its block styled as an informational note.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Status.Success

Shows its block styled as a success.

Block

A block of nested content run inside this component.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Theme.Set

Applies a theme to its block.

Parameters

NameTypeDescription
themeUi.Theme.DataThe theme to apply.

Block

The content the theme applies to.

Returns

Returns nothing — emits the component into the surrounding UI tree.

Ui.Theme.Variant

Switches to a named variant of the current theme for its block.

Parameters

NameTypeDescription
variantNameTextThe variant name to use.

Block

The content the variant applies to.

Returns

Returns nothing — emits the component into the surrounding UI tree.