Map
A container with key-value pairs.

Properties
Name | Type | Description |
---|---|---|
Header | HeaderProps | The optiional header for the map. |
Sections | {{ Key: string, Value: string | MapValueProps }} | The key-value pairs for the map. |
@OnItemUpdate | (itemName: string, itemIdx: number, newValue: unknown, oldValue: unknown) -> () | A function that runs when one of the key-value pairs is updated. |
Header Properties (HeaderProps
)
Name | Type | Description |
---|---|---|
Text | Fusion.UsedAs<string> | The Text (title) for the header. |
IsExpanded | Fusion.UsedAs<boolean>? | If the container should be expanded. |
Content | Fusion.UsedAs<Fusion.Child>? | The header content (aligned to the right). |
Disabled | Fusion.UsedAs<boolean>? | If the header is to be disabled. Designed for toggling the header via a state object. |
Map Value Properties (MapValueProps
)
Name | Type | Description |
---|---|---|
Text | Fusion.UsedAs<string>? | The text for the value. |
Placeholder | Fusion.UsedAs<string>? | The optional placeholder text for the value. |
Validation | string | ValidationProps | nil | The optional validation for the value. |
Validation Properties (ValidationProps
)
Name | Type | Description |
---|---|---|
Pattern | Fusion.UsedAs<string> | The string pattern (opens in a new tab) that the text input's data must conform to. |
Mode | Fusion.UsedAs<"Restrict" | "ErrorVisual" | nil> | Restrict prevents data that does not match the pattern from being inside of the text input whilst ErrorVisual shows a red outline around the text input when its data does not conform to the pattern. |
Example
Scope:Map {
Header = { Text = "Parameters" },
Sections = {
{ Key = "Scale", Value = { Text = "0", Validation = "%d+" } },
{ Key = "Name", Value = "CoolName" } :: any,
{ Key = "Type", Value = "MyType" } :: any,
}
}