Components
Map

Map

A container with key-value pairs.

Properties

NameTypeDescription
HeaderHeaderPropsThe 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)

NameTypeDescription
TextFusion.UsedAs<string>The Text (title) for the header.
IsExpandedFusion.UsedAs<boolean>?If the container should be expanded.
ContentFusion.UsedAs<Fusion.Child>?The header content (aligned to the right).
DisabledFusion.UsedAs<boolean>?If the header is to be disabled. Designed for toggling the header via a state object.

Map Value Properties (MapValueProps)

NameTypeDescription
TextFusion.UsedAs<string>?The text for the value.
PlaceholderFusion.UsedAs<string>?The optional placeholder text for the value.
Validationstring | ValidationProps | nilThe optional validation for the value.

Validation Properties (ValidationProps)

NameTypeDescription
PatternFusion.UsedAs<string>The string pattern (opens in a new tab) that the text input's data must conform to.
ModeFusion.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,
  }
}