UI Design

UIs for jamovi analyses are defined in the .u.yaml file (A refresher on the files and the relationship between them is described here). This describes what sort of control each option is represented by (i.e. a dropdown list, or some radio buttons), and the order and the layout in which they will appear.

aggressive vs tame compiler mode

When you first create an analysis, jamovi manages the .u.yaml file for you. This behavior is controlled by the compilerMode property:

Tip

Start Aggressive, Stay Tame. Use aggressive mode while you are defining your analysis’s core features. Switch to tame only when you are ready to “polish” the visual layout.

UI Best Practices Checklist

To ensure your analysis feels like a native part of jamovi, follow these design principles:

Controls

As we’ve seen earlier in this tutorial series with our t-test example, each option is represented by one or more controls. Our list option was represented by a list box, boolean options were represented by checkboxes, and Variable options were represented as a box that variables could be dragged to.

Let’s take a look at UI, and the .u.yaml file which is responsible for it:

Jamovi screenshot

title: Independent Samples T-Test
name: ttestIS
jus: '3.0'
stage: 0
compilerMode: aggressive

children:

  - type: VariableSupplier
    persistentItems: false
    stretchFactor: 1
    children:

      - type: TargetLayoutBox
        label: Dependent Variables
        children:
          - type: VariablesListBox
            name: deps
            isTarget: true

      - type: TargetLayoutBox
        label: Grouping Variable
        children:
          - type: VariablesListBox
            name: group
            maxItemCount: 1
            isTarget: true

  - type: LayoutBox
    margin: large
    children:
      - type: ComboBox
        name: alt

  - type: LayoutBox
    margin: large
    children:
      - type: CheckBox
        name: varEq

As can be seen, controls are arranged in a hierarchy. At the very top is a control of type VariableSupplier. It has two children: deps of type VariablesListBox and group of type VariableListBox. Together, these three controls create the variables list, and the ‘Dependent Variables’ and ‘Grouping Variable’ drop targets.

Next is a LayoutBox which contains the hypothesis ComboBox, followed by another LayoutBox containing the equality of variances CheckBox. By default, items are laid out in a grid from top to bottom.

Layout and Grouping

You can control how items are arranged using the style property of a LayoutBox:

To add a heading or a custom label to a group of controls, you can use a Label control or wrap controls in a LayoutBox with a label property (like a CollapseBox).

For more advanced layouts, you can use the cell property on child controls to place them in a specific grid position within a LayoutBox.

See the LayoutBox and CollapseBox documentation for more details.

Next Step: Take your UI further with Advanced UI Design.