NativeSpacer
A customizable spacer block for Nativeblocks.
@NativeBlock(
name: "Native Spacer",
keyType: "NATIVE_SPACER",
description: "Nativeblocks spacer block",
version: 1
)
struct NativeSpacer: View
NativeSpacer provides a flexible and configurable spacer to create adjustable spacing in layouts. It can be used to define gaps with customizable dimensions and grow behavior.
Features:
-
Configurable width and height.
-
Supports fixed or flexible sizes.
Example:
NativeSpacer(
frameWidth: "infinity",
frameHeight: "notSet"
)
Inheritance
View
Properties
frameWidth
The width of the spacer.
@NativeBlockProp(
description: "The width of the spacer. It can be a fixed value, infinite, or not set.",
valuePicker: NativeBlockValuePicker.COMBOBOX_INPUT,
valuePickerOptions: [
NativeBlockValuePickerOption("notSet", "notSet"),
NativeBlockValuePickerOption("infinity", "infinity"),
],
valuePickerGroup: NativeBlockValuePickerPosition("Size")
)
var frameWidth: String = "notSet"
The frameWidth determines how the spacer behaves horizontally. It can either have a fixed value, be infinite to grow within its container, or be unset (notSet) to rely on the layout's default behavior.
frameHeight
The height of the spacer.
@NativeBlockProp(
description: "The height of the spacer. It can be a fixed value, infinite, or not set.",
valuePicker: NativeBlockValuePicker.COMBOBOX_INPUT,
valuePickerOptions: [
NativeBlockValuePickerOption("notSet", "notSet"),
NativeBlockValuePickerOption("infinity", "infinity"),
],
valuePickerGroup: NativeBlockValuePickerPosition("Size")
)
var frameHeight: String = "notSet"
The frameHeight determines how the spacer behaves vertically. It can either have a fixed value, be infinite to grow within its container, or be unset (notSet) to rely on the layout's default behavior.
body
var body: some View