Spectrum Components API

Schema version: 6.0.0

Tooltip

Tooltips show contextual help or information about specific components when a user hovers or focuses on them.

PropertyValuesDefault valueRequired
label
text
-
variant
neutral / informative / negative
neutral
has icon
yes / no
If the neutral variant, there is never an icon.
no
max width
yes / no
nono
placement
top / bottom / left / right
top
should flip
yes / no
no
offset
yes / no
nono
container padding
yes / no
nono
{
  "slug": "tooltip",
  "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/component.json",
  "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/components/tooltip.json",
  "title": "Tooltip",
  "description": "Tooltips show contextual help or information about specific components when a user hovers or focuses on them.",
  "meta": {
    "category": "feedback",
    "documentationUrl": "https://spectrum.adobe.com/page/tooltip/"
  },
  "type": "object",
  "properties": {
    "label": {
      "type": "string"
    },
    "variant": {
      "type": "string",
      "enum": [
        "neutral",
        "informative",
        "negative"
      ],
      "default": "neutral"
    },
    "hasIcon": {
      "type": "boolean",
      "description": "If the neutral variant, there is never an icon.",
      "default": false
    },
    "maxWidth": {
      "type": "number",
      "default": 160,
      "description": "units: pixels"
    },
    "placement": {
      "type": "string",
      "enum": [
        "top",
        "bottom",
        "left",
        "right"
      ],
      "default": "top"
    },
    "shouldFlip": {
      "type": "boolean",
      "default": false
    },
    "offset": {
      "type": "number",
      "default": 4,
      "description": "units: pixels"
    },
    "containerPadding": {
      "type": "number",
      "default": 8,
      "description": "units: pixels"
    }
  }
}
← Back to home