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
- padding
- INTEGER
- Default:
0, Range:0-64
Inset the content around the perimeter of the view by the padding amount.
- 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.
- 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. |
NoteUse this property sparingly. It is preferable to leave this as
automaticand make your UI light/dark mode compatible.
- 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.
NoteThere is also a
shortcutSTRING 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.