Shared Properties

Each component shares the following properties:

type
ENUM
Default: "view"

The type of the component you would like to use.

The available types are documented on the Components page.

id
STRING
Unique

The identifier of a component which can be referenced later in action arguments using {value:id.property}, or when updating or replacing UI components by id.

Important

To prevent confusion, ensure that id is kept globally unique throughout your UI.

Note

The special "file" type component which refers to other files can have an id set on it, but this can be overriden by an id in the file you refer to.

constraints
OBJECT
View properties

The constraints used by the Layout.

events
ARRAY | EVENT

An array of event objects for this component.

focus
BOOL
Set on a single component

Sets this component to be intially focused when the JSON is parsed.

hidden
BOOL
Default: false

Visually hides the component when set to true, the component will still take up space.

opacity
DOUBLE
Default: 1.0, Range: 0.0-1.0

Opacity of the component.

enabled
BOOL
Default: true

When enabled is set to false, the component will be disabled and won't accept user input.

tooltip
STRING

A tooltip when the component is hovered over.

menu
ARRAY
Of type: MENU

An array of MENU items to provide a popup menu for this component.

It is also possible to dynamically create popup menus using the popupmenu JSON Action.

shortcut
STRING
Only supported by certain actionable components

The keyboard shortcut to directly trigger the action of this component.

e.g. For a Save button, you could set "⌘S" to make the key combo ⌘S trigger the configured "actioned" event for that button.

Tip

Use the following modifier characters to composite your shortcut string: ⌘ ⇧ ⌃ ⌥ ↩︎

Note

This property sets the AppKit keyEquivalent directly on actionable components, including buttons, checkboxes and pickers.

This is different to the shortcuts property on the view component, which is a way of assigning an ARRAY of actions to keyboard shortcuts.

accessibility
OBJECT

Add additional accessibility properties to a UI component.

Note

Please make your workflows accessible where possible.

label
STRING

Sets the AppKit accessibilityLabel property, a short description of this component. If possible, use a single word, and to ensure correct VoiceOver intonation, start with a capital letter. Do not use a full stop at the end.

help
STRING

Sets the AppKit accessibilityHelp property. Use this property only when the results of activating this element are not obvious from the element’s label. This string functions as a tooltip when pausing over a component. For VoiceOver, use proper sentence finishing in a full stop.