{
  "_copyright": "Copyright (c) 2026, Salesforce, Inc., All rights reserved. For full license text, see the LICENSE.txt file",
  "$schema": "https://slds.lightningdesignsystem.com/schemas/uif-foundation.v1.json",
  "apiVersion": "1.0.0",
  "name": "Input",
  "description": "Initializes text input",
  "structure": {
    "name": "root",
    "restrict": [
      "div"
    ],
    "description": "Input container",
    "children": [
      {
        "name": "label",
        "restrict": [
          "label",
          "span"
        ],
        "description": "Input label. Renders as a span when there is no associated native input (static read-only display).",
        "attributes": {
          "bound": {
            "for": {
              "prop": "inputId"
            },
            "id": {
              "prop": "labelId"
            }
          }
        },
        "slot": {
          "name": "label",
          "required": true
        },
        "children": [
          {
            "name": "requiredIndicator",
            "restrict": [
              "abbr"
            ],
            "description": "Required-field asterisk shown inside the label when the input is required.",
            "renderWhen": {
              "prop": "required",
              "eq": "true"
            },
            "attributes": {
              "bound": {
                "title": {
                  "prop": "requiredLabel"
                }
              }
            }
          }
        ]
      },
      {
        "name": "helpIcon",
        "restrict": [
          "div"
        ],
        "description": "Field-level help affordance: an info button that toggles a tooltip popover.",
        "renderWhen": "slotFilled",
        "children": [
          {
            "name": "helpButton",
            "restrict": [
              "button"
            ],
            "description": "Button that opens the field-level help tooltip.",
            "attributes": {
              "bound": {
                "aria-describedby": {
                  "prop": "helpTooltipId"
                }
              }
            },
            "children": [
              {
                "name": "helpButtonIcon",
                "description": "SVG icon inside the help button.",
                "component": "PrimitiveIcon"
              },
              {
                "name": "helpButtonAssistiveText",
                "restrict": [
                  "span"
                ],
                "description": "Visually hidden label for the help button."
              }
            ]
          },
          {
            "name": "helpPopover",
            "restrict": [
              "div"
            ],
            "description": "Tooltip popover anchored to the help button.",
            "attributes": {
              "bound": {
                "id": {
                  "prop": "helpTooltipId"
                }
              }
            },
            "slot": {
              "name": "helpTooltip"
            },
            "children": [
              {
                "name": "helpPopoverBody",
                "restrict": [
                  "div"
                ],
                "description": "Body container for the help tooltip text."
              }
            ]
          }
        ]
      },
      {
        "name": "inputContainer",
        "restrict": [
          "div"
        ],
        "description": "Container wrapping the native input, inline icons, addons, and any inline spinner.",
        "children": [
          {
            "name": "addonPre",
            "restrict": [
              "span"
            ],
            "description": "Fixed text shown before the input (e.g. a currency symbol).",
            "renderWhen": "slotFilled",
            "attributes": {
              "bound": {
                "id": {
                  "prop": "addonPreId"
                }
              }
            },
            "slot": {
              "name": "addonPre"
            }
          },
          {
            "name": "iconLeft",
            "description": "Decorative icon rendered before the input.",
            "renderWhen": "slotFilled",
            "slot": {
              "name": "iconLeft",
              "restrict": [
                "Icon"
              ]
            },
            "component": "PrimitiveIcon"
          },
          {
            "name": "iconError",
            "description": "Inline error glyph shown on the left when the input is in an error state.",
            "renderWhen": {
              "prop": "hasError",
              "eq": "true"
            },
            "component": "PrimitiveIcon"
          },
          {
            "name": "input",
            "restrict": [
              "input"
            ],
            "description": "Native input element",
            "attributes": {
              "bound": {
                "id": {
                  "prop": "inputId",
                  "required": true
                },
                "type": {
                  "prop": "type"
                },
                "name": {
                  "prop": "name"
                },
                "value": {
                  "prop": "value"
                },
                "placeholder": {
                  "prop": "placeholder"
                },
                "disabled": {
                  "prop": "disabled"
                },
                "readonly": {
                  "prop": "readonly"
                },
                "required": {
                  "prop": "required"
                },
                "maxlength": {
                  "prop": "maxLength"
                },
                "minlength": {
                  "prop": "minLength"
                },
                "pattern": {
                  "prop": "pattern"
                },
                "aria-describedby": {
                  "prop": "ariaDescribedBy"
                },
                "aria-invalid": {
                  "prop": "hasError"
                },
                "aria-labelledby": {
                  "prop": "ariaLabelledBy"
                }
              }
            }
          },
          {
            "name": "addonPost",
            "restrict": [
              "span"
            ],
            "description": "Fixed text shown after the input (e.g. a unit suffix).",
            "renderWhen": "slotFilled",
            "attributes": {
              "bound": {
                "id": {
                  "prop": "addonPostId"
                }
              }
            },
            "slot": {
              "name": "addonPost"
            }
          },
          {
            "name": "iconRight",
            "description": "Decorative icon rendered after the input.",
            "renderWhen": "slotFilled",
            "slot": {
              "name": "iconRight",
              "restrict": [
                "Icon"
              ]
            },
            "component": "PrimitiveIcon"
          },
          {
            "name": "iconRightButton",
            "restrict": [
              "button"
            ],
            "description": "Interactive trailing button (e.g. a clear action) rendered in place of a passive right icon.",
            "children": [
              {
                "name": "iconRightButtonIcon",
                "description": "SVG icon inside the trailing action button.",
                "component": "PrimitiveIcon"
              },
              {
                "name": "iconRightButtonAssistiveText",
                "restrict": [
                  "span"
                ],
                "description": "Visually hidden label for the trailing action button."
              }
            ]
          },
          {
            "name": "iconGroupRight",
            "restrict": [
              "div"
            ],
            "description": "Container that groups an inline spinner together with a trailing action button on the right.",
            "children": [
              {
                "name": "spinner",
                "restrict": [
                  "div"
                ],
                "description": "Inline loading spinner shown inside the input.",
                "renderWhen": {
                  "prop": "loading",
                  "eq": "true"
                },
                "children": [
                  {
                    "name": "spinnerAssistiveText",
                    "restrict": [
                      "span"
                    ],
                    "description": "Visually hidden status text for the spinner."
                  },
                  {
                    "name": "spinnerDotA",
                    "restrict": [
                      "div"
                    ],
                    "description": "First animated dot of the spinner."
                  },
                  {
                    "name": "spinnerDotB",
                    "restrict": [
                      "div"
                    ],
                    "description": "Second animated dot of the spinner."
                  }
                ]
              },
              {
                "name": "iconGroupButton",
                "restrict": [
                  "button"
                ],
                "description": "Trailing action button within the icon group.",
                "children": [
                  {
                    "name": "iconGroupButtonIcon",
                    "description": "SVG icon inside the icon-group button.",
                    "component": "PrimitiveIcon"
                  },
                  {
                    "name": "iconGroupButtonAssistiveText",
                    "restrict": [
                      "span"
                    ],
                    "description": "Visually hidden label for the icon-group button."
                  }
                ]
              }
            ]
          },
          {
            "name": "staticValue",
            "restrict": [
              "span"
            ],
            "description": "Static read-only value rendered in place of a native input.",
            "renderWhen": {
              "prop": "readonly",
              "eq": "static"
            },
            "slot": {
              "name": "staticValue"
            }
          }
        ]
      },
      {
        "name": "helpText",
        "restrict": [
          "div"
        ],
        "description": "Help or error message rendered below the input.",
        "renderWhen": "slotFilled",
        "attributes": {
          "bound": {
            "id": {
              "prop": "helpTextId"
            }
          }
        },
        "slot": {
          "name": "helpText"
        }
      }
    ]
  },
  "states": [
    {
      "name": "disabled",
      "type": "boolean",
      "aria": "aria-disabled",
      "description": "Whether the input is disabled"
    },
    {
      "name": "readonly",
      "type": "boolean",
      "aria": "aria-readonly",
      "description": "Whether the input is read-only"
    },
    {
      "name": "required",
      "type": "boolean",
      "aria": "aria-required",
      "description": "Whether the input is required"
    },
    {
      "name": "hasError",
      "type": "boolean",
      "aria": "aria-invalid",
      "description": "Whether the input has a validation error"
    },
    {
      "name": "loading",
      "type": "boolean",
      "description": "Whether the input is showing an inline loading spinner"
    }
  ],
  "accessibility": {
    "requirements": [
      {
        "id": "label-association",
        "description": "Input must have an associated label via for/id, or be labelled via aria-labelledby when addons participate in the accessible name."
      },
      {
        "id": "error-association",
        "description": "Error messages must be associated via aria-describedby and the input must expose aria-invalid='true'."
      },
      {
        "id": "decorative-icon-hidden",
        "description": "Decorative inline icons must be marked aria-hidden='true' so they are not announced to assistive tech."
      },
      {
        "id": "field-level-help",
        "description": "Field-level help tooltips must use role='tooltip' and be referenced from the trigger button via aria-describedby."
      },
      {
        "id": "spinner-status",
        "description": "Inline loading spinners must expose role='status' and a visually-hidden status label."
      }
    ]
  },
  "componentRefs": {
    "PrimitiveIcon": {
      "description": "Bare SVG icon composed directly inside the component. The host node supplies the SVG class (e.g. slds-button__icon, slds-menu__item-icon) via componentProps; PrimitiveIcon contributes the sprite-href binding.",
      "props": {
        "iconName": {
          "type": "string",
          "required": true,
          "description": "Sprite reference for the icon glyph"
        }
      }
    }
  }
}
