FieldInfo
There are multiple variants of FieldInfo
. The most common is the BlockFieldInfo
, which is used to specify a field that is a block. The other variants encode "Simple" fields, such as numbers, strings, booleans, and options.
BlockFieldInfo
Name | Type | Required | Description | Example |
---|---|---|---|---|
id | string | ★ | The key that is used for storing this data in the block data. Matches the key of the item in properties. |
|
name | string | SimpleOptionsFieldInfo | ★ | The name of the field that is shown to the user |
|
accepts | string[] | ★ | The keys for block types that are allowed to be used in this field |
|
default | any | ★ | The default value for the field | - |
isList | boolean | Whether the field can accept multiple values |
| |
fullWidth | boolean | Whether the field should take up the full width of the drawer |
| |
type | PropertyType.Block | ★ | Indicator for this field being a block |
|
SimpleBooleanFieldInfo
Name | Type | Required | Description | Example |
---|---|---|---|---|
id | string | ★ | The key that is used for storing this data in the block data. Matches the key of the item in properties. |
|
name | string | ★ | The name of the field that is shown to the user |
|
default | boolean | ★ | The default value for the field |
|
type | PropertyType.Boolean | ★ | Indicator for this field being a boolean |
|
SimpleNumberFieldInfo
Name | Type | Required | Description | Example |
---|---|---|---|---|
id | string | ★ | The key that is used for storing this data in the block data. Matches the key of the item in properties. |
|
name | string | ★ | The name of the field that is shown to the user |
|
default | number | ★ | The default value for the field |
|
type | PropertyType.Number | ★ | Indicator for this field being a number |
|
min | number | Minimum value for field. Defaults to -∞ |
| |
max | number | Maximum value for field. Defaults to ∞ |
| |
step | number | Step value for field. Defaults to 1 |
| |
units | string | The units for the number field. Defaults to none. |
|
SimpleStringFieldInfo
Name | Type | Required | Description | Example |
---|---|---|---|---|
id | string | ★ | The key that is used for storing this data in the block data. Matches the key of the item in properties. |
|
name | string | ★ | The name of the field that is shown to the user |
|
default | string | ★ | The default value for the field |
|
type | PropertyType.String | ★ | Indicator for this field being a string |
|
SimpleOptionsFieldInfo
Name | Type | Required | Description | Example |
---|---|---|---|---|
id | string | ★ | The key that is used for storing this data in the block data. Matches the key of the item in properties. |
|
name | string | ★ | The name of the field that is shown to the user |
|
default | string | ★ | The default option selected, based on value. |
|
type | PropertyType.Options | ★ | Indicator for this field being a set of options |
|
options | {value: string, label: string}[] | ★ | Options for the user to select from. Value stored is the value field. |
|
SimpleMetadataFieldInfo
Name | Type | Required | Description | Example |
---|---|---|---|---|
id | string | ★ | The key that is used for storing this data in the block data. Matches the key of the item in properties. |
|
name | string | ★ | The name of the field (although metadata isn't displayed to the user). |
|
default | any | ★ | The default value for the field |
|
type | PropertyType.Metadata | ★ | Indicator for this field being metadata |
|
SimpleVector3FieldInfo
Name | Type | Required | Description | Example |
---|---|---|---|---|
id | string | ★ | The key that is used for storing this data in the block data. Matches the key of the item in properties. |
|
name | string | ★ | The name of the field that is shown to the user |
|
default | number[] | ★ | The default value of the vector3 field |
|
type | PropertyType.Vector3 | ★ | Indicator for this field being a vector-3 |
|