view Component

A view is a container for components.

The positioning of the components is delegated to a layout.

{
  "type": "view",
  "layout": "border",
  "components": [
  ]
}

Properties

layout
ENUM
Default: "stack"

The layout to use for this view.

Value Description
"stack" The stack layout.
"border" The border layout.
"grid" The grid layout.
"inline" The inline layout.
"form" The form layout.
"flex" The flex layout.
components
ARRAY
Of type: component

Array of Alfred UI components to add to this view.

padding
INTEGER
Default: 0, Range: 0-64

Inset the content around the perimeter of the view by the padding amount.

spacing
INTEGER
Default: 0, Range: 0-64

Add spacing between the components in the view.

cliptobounds
BOOL
Default: false

Clip the contents to the bounds of the view. Can have a small performance impact with a plethora of complex views.

cornerradius
INTEGER
Default: 0, Range: 0-32

The corner radius of this view.

appearance
ENUM
Default: "inherit"

Override the macOS appearance for this view, which will alter how all subviews and components are rendered.

Value Description
"inherit" Inherit from the up view hierarchy, the default and recommended mode to use.
"light" Force light mode on this view and any subviews / components.
"dark" Force light mode on this view and any subviews / components.
Note

Use this property sparingly. It is preferable to leave this as automatic and make your UI light/dark mode compatible.

background
COLOUR | null
null removes the background

The background COLOUR.

border
OBJECT

An overlaid inset border for this component.

width
INTEGER
Default: 0, Range: 0-32

The width of the border for this view in pixels.

colour
COLOUR | null
null removes the border

The border COLOUR.

focusable
BOOL
Default: false

Allows this view to act like a component by accepting the system focus.

shortcuts
ARRAY
Of type: SHORTCUT

An array of SHORTCUT objects to process for this view.

Shortcuts are only processed when the currently focused component is a descendant of the view with the shortcuts set, and the deepest shortcuts (e.g. at the root view) take precedence.

Note

There is also a shortcut STRING shared property some components, such as buttons, which trigger the component's action directly.

vetomovablebybackground
BOOL
Default: false

If a window is set to be movable by background, this will veto that behaviour. Useful for creating custom components.

Also see Shared Properties.