Skip to content

Infer Number Props

When enabled, TEXT code-only props whose default and all examples parse as valid numbers (no leading zeros) are emitted as NumberProp instead of StringProp. The example below uses a Text Area that exposes code-only props whose values are purely numeric strings — minRows = "2", maxRows = "6", minLength = "3".

Configuration

config:
processing:
inferNumberProps: true # Infer numeric code-only props as NumberProp

Result

Without inference (false) the numeric values stay string props:

{
"props": {
"minRows": { "type": "string", "default": "2" },
"maxRows": { "type": "string", "examples": ["6"] },
"minLength": { "type": "string", "examples": ["3"] }
}
}

With inference (true) they are emitted as number props:

{
"props": {
"minRows": { "type": "number", "default": 2 },
"maxRows": { "type": "number", "examples": [6] },
"minLength": { "type": "number", "examples": [3] }
}
}

Text code-only props whose values aren’t purely numeric (e.g. value = "{Value}") are unaffected and remain string props.

Options

  • Type: boolean
  • Default: false
  • Effect: When true, text code-only props with purely numeric values are inferred as number props. When false, all text code-only props remain string props.

Path

config.processing.inferNumberProps