Spectrum Components API

Schema version: 6.0.0

Picker

Pickers (sometimes known as "dropdowns" or "selects") allow users to choose from a list of options in a limited space. The list of options can change based on the context.

PropertyValuesDefault valueRequired
label
text
-
label position
top / side
top
placeholder
text
-
value
text
-
width
yes / no
nono
size
s / m / l / xl
m
is quiet
yes / no
no
necessity indicator
text / icon
icon
is required
yes / no
no
menu container
popover / tray
popover
is disabled
yes / no
no
is error
yes / no
no
description
text
-
error message
text
-
state
default / hover / focus + hover / focus + not hover / keyboard focus
default
{
  "slug": "picker",
  "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/component.json",
  "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/components/picker.json",
  "title": "Picker",
  "description": "Pickers (sometimes known as \"dropdowns\" or \"selects\") allow users to choose from a list of options in a limited space. The list of options can change based on the context.",
  "meta": {
    "category": "inputs",
    "documentationUrl": "https://spectrum.adobe.com/page/picker/"
  },
  "type": "object",
  "properties": {
    "label": {
      "type": "string"
    },
    "labelPosition": {
      "type": "string",
      "default": "top",
      "enum": [
        "top",
        "side"
      ]
    },
    "placeholder": {
      "type": "string"
    },
    "value": {
      "type": "string"
    },
    "width": {
      "type": "number",
      "description": "Not applicable to quiet picker."
    },
    "size": {
      "type": "string",
      "enum": [
        "s",
        "m",
        "l",
        "xl"
      ],
      "default": "m"
    },
    "isQuiet": {
      "type": "boolean",
      "default": false
    },
    "necessityIndicator": {
      "type": "string",
      "enum": [
        "text",
        "icon"
      ],
      "default": "icon"
    },
    "isRequired": {
      "type": "boolean",
      "default": false
    },
    "menuContainer": {
      "type": "string",
      "enum": [
        "popover",
        "tray"
      ],
      "default": "popover"
    },
    "isDisabled": {
      "type": "boolean",
      "default": false
    },
    "isError": {
      "type": "boolean",
      "default": false
    },
    "description": {
      "type": "string",
      "default": null
    },
    "errorMessage": {
      "type": "string",
      "default": null
    },
    "state": {
      "type": "string",
      "enum": [
        "default",
        "hover",
        "focus + hover",
        "focus + not hover",
        "keyboard focus"
      ],
      "default": "default"
    }
  }
}
← Back to home