{
  "_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": "Pill",
  "description": "Initializes pill",
  "structure": {
    "name": "root",
    "restrict": [
      "span"
    ],
    "description": "Initializes pill",
    "children": [
      {
        "name": "tooltip",
        "restrict": [
          "div"
        ],
        "description": "Tooltip popover shown when the label is truncated",
        "renderWhen": "propFilled",
        "children": [
          {
            "name": "tooltipBody",
            "restrict": [
              "div"
            ],
            "description": "Tooltip popover body containing the full label text"
          }
        ]
      },
      {
        "name": "iconContainer",
        "restrict": [
          "span"
        ],
        "description": "Pill icon container that hosts an avatar or icon graphic",
        "renderWhen": "slotFilled",
        "slot": {
          "name": "icon",
          "restrict": [
            "Icon",
            "Avatar"
          ]
        },
        "children": [
          {
            "name": "avatar",
            "restrict": [
              "span"
            ],
            "description": "Avatar graphic rendered inside the icon container",
            "renderWhen": {
              "prop": "iconType",
              "eq": "avatar"
            },
            "children": [
              {
                "name": "avatarImage",
                "restrict": [
                  "img"
                ],
                "description": "Avatar image element"
              }
            ]
          },
          {
            "name": "icon",
            "restrict": [
              "span"
            ],
            "description": "Icon graphic container rendered inside the pill icon container",
            "renderWhen": {
              "prop": "iconType",
              "eq": "icon"
            },
            "children": [
              {
                "name": "iconSvg",
                "description": "Icon SVG element",
                "component": "PrimitiveIcon"
              },
              {
                "name": "iconAssistiveText",
                "restrict": [
                  "span"
                ],
                "description": "Accessible label describing the icon"
              }
            ]
          }
        ]
      },
      {
        "name": "action",
        "restrict": [
          "a"
        ],
        "description": "Linked pill action wrapper around the label",
        "renderWhen": {
          "prop": "linked",
          "eq": "true"
        },
        "children": [
          {
            "name": "actionLabel",
            "restrict": [
              "span"
            ],
            "description": "Pill label text when wrapped by the action link"
          }
        ]
      },
      {
        "name": "label",
        "restrict": [
          "span"
        ],
        "description": "Pill label",
        "slot": {
          "name": "default",
          "required": true
        }
      },
      {
        "name": "remove",
        "restrict": [
          "span",
          "button"
        ],
        "description": "Remove control. May be a button directly or a wrapper span containing a button.",
        "renderWhen": "slotFilled",
        "slot": {
          "name": "remove",
          "restrict": [
            "Button"
          ]
        },
        "children": [
          {
            "name": "removeButton",
            "restrict": [
              "button"
            ],
            "description": "Remove button element"
          },
          {
            "name": "removeIcon",
            "description": "Remove button close-icon SVG",
            "component": "PrimitiveIcon"
          },
          {
            "name": "removeAssistiveText",
            "restrict": [
              "span"
            ],
            "description": "Accessible label for the remove control"
          }
        ]
      },
      {
        "name": "container",
        "restrict": [
          "div"
        ],
        "description": "Container that groups multiple pills",
        "children": [
          {
            "name": "listbox",
            "restrict": [
              "ul"
            ],
            "description": "Horizontal listbox of selectable pill options",
            "renderWhen": {
              "prop": "listbox",
              "eq": "true"
            },
            "children": [
              {
                "name": "listboxItem",
                "restrict": [
                  "li"
                ],
                "description": "Individual pill option in the listbox",
                "repeats": true
              }
            ]
          }
        ]
      },
      {
        "name": "selectionGroup",
        "restrict": [
          "div"
        ],
        "description": "Selection group wrapper that pairs a combobox container with a pill listbox",
        "renderWhen": {
          "prop": "withCombobox",
          "eq": "true"
        },
        "children": [
          {
            "name": "comboboxContainer",
            "restrict": [
              "div"
            ],
            "description": "Sibling combobox container for the selection group"
          }
        ]
      }
    ]
  },
  "states": [
    {
      "name": "hasError",
      "type": "boolean",
      "aria": "aria-invalid",
      "description": "Whether the pill is in an error state"
    },
    {
      "name": "disabled",
      "type": "boolean",
      "aria": "aria-disabled",
      "description": "Whether the pill is disabled"
    },
    {
      "name": "selected",
      "type": "boolean",
      "aria": "aria-selected",
      "description": "Whether the pill is selected"
    }
  ],
  "accessibility": {
    "requirements": [
      {
        "id": "remove-accessible",
        "description": "Remove button must have accessible label indicating what will be removed"
      },
      {
        "id": "icon-assistive-text",
        "description": "Decorative icons inside the pill must mark their SVG aria-hidden=\"true\" and provide a sibling assistive-text label."
      },
      {
        "id": "listbox-label",
        "description": "Pill listboxes must expose an accessible name via aria-label and may reference a describing element via aria-describedby."
      }
    ]
  },
  "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"
        }
      }
    }
  }
}
