# Picker (/docs/agent-ui/components/picker)

Use a picker when people choose where or what the agent works on, from more items than fit in a row of buttons. The button shows the chosen item, and pressing it opens a search field over the list, with footer actions like **New project** below it.

<Example caption="Press Work in, type doc to find docs, then press Enter. Choose New project to add one and choose it.">
  <PickerExample />

  ```tsx tab="React"
  "use client";
  import { useState } from "react";
  import { Picker } from "@/components/ui/picker";

  function FolderIcon() {
    return (
      <svg
        viewBox="0 0 24 24"
        fill="none"
        stroke="currentColor"
        strokeWidth="2"
        strokeLinecap="round"
        strokeLinejoin="round"
        aria-hidden="true"
      >
        <path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" />
      </svg>
    );
  }

  function PlusIcon() {
    return (
      <svg
        viewBox="0 0 24 24"
        fill="none"
        stroke="currentColor"
        strokeWidth="2"
        strokeLinecap="round"
        strokeLinejoin="round"
        aria-hidden="true"
      >
        <path d="M5 12h14" />
        <path d="M12 5v14" />
      </svg>
    );
  }

  const initialProjects = [
    { value: "agent-ui", label: "agent-ui", description: "~/code/agent-ui", icon: <FolderIcon /> },
    { value: "docs", label: "docs", description: "~/code/docs", icon: <FolderIcon /> },
    { value: "registry", label: "registry", description: "~/code/registry", icon: <FolderIcon /> },
  ];

  export default function PickerExample() {
    const [projects, setProjects] = useState(initialProjects);
    const [project, setProject] = useState<string | null>("agent-ui");
    return (
      <Picker
        label="Work in"
        placeholder="Search projects…"
        items={projects}
        actions={[{ id: "new-project", label: "New project", icon: <PlusIcon /> }]}
        value={project}
        onValueChange={setProject}
        onAction={() => {
          const value = `untitled-${projects.length - initialProjects.length + 1}`;
          setProjects([
            ...projects,
            { value, label: value, description: `~/code/${value}`, icon: <FolderIcon /> },
          ]);
          setProject(value);
        }}
      />
    );
  }
  ```

  ```vue tab="Vue"
  <script setup lang="ts">
  import { h, ref, shallowRef } from "vue";
  import { Picker } from "@/components/ui/vue/picker";

  const svg = (...children: ReturnType<typeof h>[]) =>
    h(
      "svg",
      {
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        "stroke-width": "2",
        "stroke-linecap": "round",
        "stroke-linejoin": "round",
        "aria-hidden": "true",
      },
      children,
    );
  const folderIcon = () =>
    svg(
      h("path", {
        d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
      }),
    );
  const plusIcon = () => svg(h("path", { d: "M5 12h14" }), h("path", { d: "M12 5v14" }));

  const initialProjects = [
    { value: "agent-ui", label: "agent-ui", description: "~/code/agent-ui", icon: folderIcon() },
    { value: "docs", label: "docs", description: "~/code/docs", icon: folderIcon() },
    { value: "registry", label: "registry", description: "~/code/registry", icon: folderIcon() },
  ];

  const projects = shallowRef(initialProjects);
  const project = ref<string | null>("agent-ui");
  const actions = [{ id: "new-project", label: "New project", icon: plusIcon() }];

  function addProject() {
    const value = `untitled-${projects.value.length - initialProjects.length + 1}`;
    projects.value = [
      ...projects.value,
      { value, label: value, description: `~/code/${value}`, icon: folderIcon() },
    ];
    project.value = value;
  }
  </script>

  <template>
    <Picker
      v-model:value="project"
      label="Work in"
      placeholder="Search projects…"
      :items="projects"
      :actions="actions"
      @action="addProject"
    />
  </template>
  ```

  ```svelte tab="Svelte"
  <script lang="ts">
    import { Picker, type PickerChoice } from "@/components/ui/svelte/picker/index.js";

    const initialProjects: PickerChoice[] = [
      { value: "agent-ui", label: "agent-ui", description: "~/code/agent-ui", icon: folderIcon },
      { value: "docs", label: "docs", description: "~/code/docs", icon: folderIcon },
      { value: "registry", label: "registry", description: "~/code/registry", icon: folderIcon },
    ];

    let projects = $state.raw(initialProjects);
    let project = $state<string | null>("agent-ui");

    function addProject() {
      const value = `untitled-${projects.length - initialProjects.length + 1}`;
      projects = [...projects, { value, label: value, description: `~/code/${value}`, icon: folderIcon }];
      project = value;
    }
  </script>

  {#snippet folderIcon()}
    <svg
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      stroke-width="2"
      stroke-linecap="round"
      stroke-linejoin="round"
      aria-hidden="true"
    >
      <path
        d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"
      />
    </svg>
  {/snippet}

  {#snippet plusIcon()}
    <svg
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      stroke-width="2"
      stroke-linecap="round"
      stroke-linejoin="round"
      aria-hidden="true"
    >
      <path d="M5 12h14" />
      <path d="M12 5v14" />
    </svg>
  {/snippet}

  <Picker
    label="Work in"
    placeholder="Search projects…"
    items={projects}
    actions={[{ id: "new-project", label: "New project", icon: plusIcon }]}
    bind:value={project}
    onAction={addProject}
  />
  ```

  ```tsx tab="Solid"
  import { createSignal } from "solid-js";
  import { Picker, type PickerChoice } from "@/components/ui/solid/picker";

  // Image URLs rather than elements: a Solid element is one DOM node, and the chosen item's icon shows in the trigger and its row at once.
  const svg = (paths: string) =>
    `data:image/svg+xml,${encodeURIComponent(
      `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#71717a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${paths}</svg>`,
    )}`;
  const folderIcon = svg(
    '<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/>',
  );
  const plusIcon = svg('<path d="M5 12h14"/><path d="M12 5v14"/>');

  const initialProjects: PickerChoice[] = [
    { value: "agent-ui", label: "agent-ui", description: "~/code/agent-ui", icon: folderIcon },
    { value: "docs", label: "docs", description: "~/code/docs", icon: folderIcon },
    { value: "registry", label: "registry", description: "~/code/registry", icon: folderIcon },
  ];

  export default function PickerExample() {
    const [projects, setProjects] = createSignal(initialProjects);
    const [project, setProject] = createSignal<string | null>("agent-ui");
    return (
      <Picker
        label="Work in"
        placeholder="Search projects…"
        items={projects()}
        actions={[{ id: "new-project", label: "New project", icon: plusIcon }]}
        value={project()}
        onValueChange={setProject}
        onAction={() => {
          const value = `untitled-${projects().length - initialProjects.length + 1}`;
          setProjects([
            ...projects(),
            { value, label: value, description: `~/code/${value}`, icon: folderIcon },
          ]);
          setProject(value);
        }}
      />
    );
  }
  ```
</Example>

## Installation [#installation]

```bash tab="React"
npx shadcn@latest add @kind-ui/picker
```

```bash tab="Web Components"
npx shadcn@latest add @kind-ui/picker-web
```

```bash tab="Vue"
npx shadcn@latest add @kind-ui/picker-vue
```

```bash tab="Svelte"
npx shadcn@latest add @kind-ui/picker-svelte
```

```bash tab="Solid"
npx shadcn@latest add @kind-ui/picker-solid
```

## Composition [#composition]

```text
Picker
├── PickerTrigger
└── PickerContent
    └── PickerList
        └── PickerSectionRows
            └── PickerRowItem
                └── PickerItem
```

`Picker` is a group named by its `label` and the chosen item. `PickerTrigger` is the button, with the chosen item's icon and label, or the `label` while nothing is chosen. `PickerContent` is the popover, and `PickerList` is UI SDK's Command inside it: the search field, the text shown while nothing matches, and every page of rows. To arrange the list yourself, pass `PickerList` a function of its state that renders `PickerSectionRows` for each section of `pages`. `PickerRowItem` is a row, and `PickerItem` is its content: its icon, label, description, trailing text and a check on the chosen item.

## Usage [#usage]

### Items [#items]

Pass `items`, each with a `value` and a `label`, and optionally a `description` (a second line under the label), `meta` (trailing text), an `icon`, `keywords`, a `group` and `disabled`. Groups show in the order they first appear. A disabled item stays in the list, its label dimmed and its description readable, so it can say why, and can't be chosen. Every `value` must be unique, on every page, and differ from every action's `id`.

In React, `icon` is an image URL or an element, like an inline `<svg>`. Icons render at 16px and are hidden from assistive technology, so the label names the row.

Pass `value` and `onValueChange` to control the chosen item, or `defaultValue` to start with one. `onValueChange` gets the item's `value`, with the reason `item-press` when a person chose it, or `imperative` from `setValue`. Choosing an item closes the list, unless you cancel the change with `details.cancel()`.

### Searching [#searching]

Typing in the search field filters the list as you type. An item matches when its label, description or `keywords` hold the letters in order, and the matching letters are marked. When nothing matches, the list shows `emptyText` ("No matches"). Set `placeholder` to change the field's "Search…".

### Actions [#actions]

Pass `actions`, each with an `id` and a `label`, for footer rows after the items, like **New project**. They show on the first page, and the arrow keys reach them like any row. Pressing one calls `onAction` with its `id` and closes the list; cancel it with `details.cancel()` to keep the list open. Without `onAction`, the actions can't run.

```tsx
<Picker
  items={projects}
  actions={[{ id: "new-project", label: "New project" }]}
  onAction={(id) => createProject()}
/>
```

### Pages [#pages]

Give an item `items` to make it open a page of them, marked with a chevron. The search starts empty on the new page, and a **Back** row (`backLabel`) is its footer. Backspace in the empty search field, or Escape once it's empty, goes back and puts the previous page's search back. `setValue` reaches an item on any page.

### Keyboard [#keyboard]

The button is one Tab stop. Enter or Space opens the list with focus in the search field. The arrow keys move the highlight, skipping disabled items, and Enter chooses. Escape clears the search, then closes the list, and focus returns to the button.

### Presentation and Motion [#presentation-and-motion]

The list opens as a popover below the button. With `presentation="auto"`, the default, it's a bottom sheet on small touch screens instead; pass `"popover"` or `"sheet"` to choose one. The popover rises and fades in. Under `prefers-reduced-motion`, or with `motion="reduced"`, it only fades, over 120 ms, and with `motion="none"` it opens at once.

### Project [#project]

Group projects by their owner with `group`, and put what each is in `description`, which the search reaches too.

<Example caption="Press Project, then type dash to find web by its description.">
  <PickerProjectExample />

  ```tsx tab="React"
  "use client";
  import { useState } from "react";
  import { Picker } from "@/components/ui/picker";

  const projects = [
    {
      value: "kind-ui/agent-ui",
      label: "agent-ui",
      description: "Chat components for agents",
      group: "kind-ui",
    },
    { value: "kind-ui/docs", label: "docs", description: "The documentation site", group: "kind-ui" },
    { value: "acme/api", label: "api", description: "Public REST API", group: "acme" },
    { value: "acme/web", label: "web", description: "Customer dashboard", group: "acme" },
    { value: "acme/legacy", label: "legacy", description: "Archived", group: "acme", disabled: true },
  ];

  export default function PickerProjectExample() {
    const [project, setProject] = useState<string | null>("kind-ui/agent-ui");
    return (
      <Picker
        label="Project"
        placeholder="Search projects…"
        items={projects}
        value={project}
        onValueChange={setProject}
      />
    );
  }
  ```

  ```vue tab="Vue"
  <script setup lang="ts">
  import { ref } from "vue";
  import { Picker } from "@/components/ui/vue/picker";

  const projects = [
    {
      value: "kind-ui/agent-ui",
      label: "agent-ui",
      description: "Chat components for agents",
      group: "kind-ui",
    },
    { value: "kind-ui/docs", label: "docs", description: "The documentation site", group: "kind-ui" },
    { value: "acme/api", label: "api", description: "Public REST API", group: "acme" },
    { value: "acme/web", label: "web", description: "Customer dashboard", group: "acme" },
    { value: "acme/legacy", label: "legacy", description: "Archived", group: "acme", disabled: true },
  ];

  const project = ref<string | null>("kind-ui/agent-ui");
  </script>

  <template>
    <Picker v-model:value="project" label="Project" placeholder="Search projects…" :items="projects" />
  </template>
  ```

  ```svelte tab="Svelte"
  <script lang="ts">
    import { Picker } from "@/components/ui/svelte/picker/index.js";

    const projects = [
      {
        value: "kind-ui/agent-ui",
        label: "agent-ui",
        description: "Chat components for agents",
        group: "kind-ui",
      },
      { value: "kind-ui/docs", label: "docs", description: "The documentation site", group: "kind-ui" },
      { value: "acme/api", label: "api", description: "Public REST API", group: "acme" },
      { value: "acme/web", label: "web", description: "Customer dashboard", group: "acme" },
      { value: "acme/legacy", label: "legacy", description: "Archived", group: "acme", disabled: true },
    ];

    let project = $state<string | null>("kind-ui/agent-ui");
  </script>

  <Picker label="Project" placeholder="Search projects…" items={projects} bind:value={project} />
  ```

  ```tsx tab="Solid"
  import { createSignal } from "solid-js";
  import { Picker } from "@/components/ui/solid/picker";

  const projects = [
    {
      value: "kind-ui/agent-ui",
      label: "agent-ui",
      description: "Chat components for agents",
      group: "kind-ui",
    },
    { value: "kind-ui/docs", label: "docs", description: "The documentation site", group: "kind-ui" },
    { value: "acme/api", label: "api", description: "Public REST API", group: "acme" },
    { value: "acme/web", label: "web", description: "Customer dashboard", group: "acme" },
    { value: "acme/legacy", label: "legacy", description: "Archived", group: "acme", disabled: true },
  ];

  export default function PickerProjectExample() {
    const [project, setProject] = createSignal<string | null>("kind-ui/agent-ui");
    return (
      <Picker
        label="Project"
        placeholder="Search projects…"
        items={projects}
        value={project()}
        onValueChange={setProject}
      />
    );
  }
  ```
</Example>

### Branch [#branch]

Put each branch's ahead and behind counts in `meta`, which sits at the end of its row, and offer **New branch** as an action.

<Example caption="Press Branch to see each branch's counts, then choose New branch to add one.">
  <PickerBranchExample />

  ```tsx tab="React"
  "use client";
  import { useState } from "react";
  import { Picker } from "@/components/ui/picker";

  function GitBranchIcon() {
    return (
      <svg
        viewBox="0 0 24 24"
        fill="none"
        stroke="currentColor"
        strokeWidth="2"
        strokeLinecap="round"
        strokeLinejoin="round"
        aria-hidden="true"
      >
        <line x1="6" x2="6" y1="3" y2="15" />
        <circle cx="18" cy="6" r="3" />
        <circle cx="6" cy="18" r="3" />
        <path d="M18 9a9 9 0 0 1-9 9" />
      </svg>
    );
  }

  const initialBranches = [
    { value: "main", label: "main", icon: <GitBranchIcon /> },
    {
      value: "picker",
      label: "picker",
      description: "Add the Picker component",
      meta: "↑3 ↓1",
      icon: <GitBranchIcon />,
    },
    { value: "menus", label: "menus", meta: "↑1 ↓4", icon: <GitBranchIcon /> },
  ];

  export default function PickerBranchExample() {
    const [branches, setBranches] = useState(initialBranches);
    const [branch, setBranch] = useState<string | null>("picker");
    return (
      <Picker
        label="Branch"
        placeholder="Search branches…"
        items={branches}
        actions={[{ id: "new-branch", label: "New branch" }]}
        value={branch}
        onValueChange={setBranch}
        onAction={() => {
          const value = `branch-${branches.length - initialBranches.length + 1}`;
          setBranches([...branches, { value, label: value, icon: <GitBranchIcon /> }]);
          setBranch(value);
        }}
      />
    );
  }
  ```

  ```vue tab="Vue"
  <script setup lang="ts">
  import { h, ref, shallowRef } from "vue";
  import { Picker } from "@/components/ui/vue/picker";

  const gitBranchIcon = () =>
    h(
      "svg",
      {
        viewBox: "0 0 24 24",
        fill: "none",
        stroke: "currentColor",
        "stroke-width": "2",
        "stroke-linecap": "round",
        "stroke-linejoin": "round",
        "aria-hidden": "true",
      },
      [
        h("line", { x1: "6", x2: "6", y1: "3", y2: "15" }),
        h("circle", { cx: "18", cy: "6", r: "3" }),
        h("circle", { cx: "6", cy: "18", r: "3" }),
        h("path", { d: "M18 9a9 9 0 0 1-9 9" }),
      ],
    );

  const initialBranches = [
    { value: "main", label: "main", icon: gitBranchIcon() },
    {
      value: "picker",
      label: "picker",
      description: "Add the Picker component",
      meta: "↑3 ↓1",
      icon: gitBranchIcon(),
    },
    { value: "menus", label: "menus", meta: "↑1 ↓4", icon: gitBranchIcon() },
  ];

  const branches = shallowRef(initialBranches);
  const branch = ref<string | null>("picker");

  function addBranch() {
    const value = `branch-${branches.value.length - initialBranches.length + 1}`;
    branches.value = [...branches.value, { value, label: value, icon: gitBranchIcon() }];
    branch.value = value;
  }
  </script>

  <template>
    <Picker
      v-model:value="branch"
      label="Branch"
      placeholder="Search branches…"
      :items="branches"
      :actions="[{ id: 'new-branch', label: 'New branch' }]"
      @action="addBranch"
    />
  </template>
  ```

  ```svelte tab="Svelte"
  <script lang="ts">
    import { Picker, type PickerChoice } from "@/components/ui/svelte/picker/index.js";

    const initialBranches: PickerChoice[] = [
      { value: "main", label: "main", icon: gitBranchIcon },
      {
        value: "picker",
        label: "picker",
        description: "Add the Picker component",
        meta: "↑3 ↓1",
        icon: gitBranchIcon,
      },
      { value: "menus", label: "menus", meta: "↑1 ↓4", icon: gitBranchIcon },
    ];

    let branches = $state.raw(initialBranches);
    let branch = $state<string | null>("picker");

    function addBranch() {
      const value = `branch-${branches.length - initialBranches.length + 1}`;
      branches = [...branches, { value, label: value, icon: gitBranchIcon }];
      branch = value;
    }
  </script>

  {#snippet gitBranchIcon()}
    <svg
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      stroke-width="2"
      stroke-linecap="round"
      stroke-linejoin="round"
      aria-hidden="true"
    >
      <line x1="6" x2="6" y1="3" y2="15" />
      <circle cx="18" cy="6" r="3" />
      <circle cx="6" cy="18" r="3" />
      <path d="M18 9a9 9 0 0 1-9 9" />
    </svg>
  {/snippet}

  <Picker
    label="Branch"
    placeholder="Search branches…"
    items={branches}
    actions={[{ id: "new-branch", label: "New branch" }]}
    bind:value={branch}
    onAction={addBranch}
  />
  ```

  ```tsx tab="Solid"
  import { createSignal } from "solid-js";
  import { Picker, type PickerChoice } from "@/components/ui/solid/picker";

  // An image URL rather than an element: a Solid element is one DOM node, and the chosen branch's icon shows in the trigger and its row at once.
  const gitBranchIcon = `data:image/svg+xml,${encodeURIComponent(
    '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#71717a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="6" x2="6" y1="3" y2="15"/><circle cx="18" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><path d="M18 9a9 9 0 0 1-9 9"/></svg>',
  )}`;

  const initialBranches: PickerChoice[] = [
    { value: "main", label: "main", icon: gitBranchIcon },
    {
      value: "picker",
      label: "picker",
      description: "Add the Picker component",
      meta: "↑3 ↓1",
      icon: gitBranchIcon,
    },
    { value: "menus", label: "menus", meta: "↑1 ↓4", icon: gitBranchIcon },
  ];

  export default function PickerBranchExample() {
    const [branches, setBranches] = createSignal(initialBranches);
    const [branch, setBranch] = createSignal<string | null>("picker");
    return (
      <Picker
        label="Branch"
        placeholder="Search branches…"
        items={branches()}
        actions={[{ id: "new-branch", label: "New branch" }]}
        value={branch()}
        onValueChange={setBranch}
        onAction={() => {
          const value = `branch-${branches().length - initialBranches.length + 1}`;
          setBranches([...branches(), { value, label: value, icon: gitBranchIcon }]);
          setBranch(value);
        }}
      />
    );
  }
  ```
</Example>

## API Reference [#api-reference]

### PickerOptions

| Prop             | Type                                                                                      | Description                                                                                                                                                                                                                                |
| ---------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `actions?`       | `PickerAction<unknown>[] \| undefined`                                                    | Footer rows after the items, like "More models", in one group the arrow keys reach. Shown on the first page. Each `id` differs from every item's `value`, since agents name both alike. Default: `[]`                                      |
| `label?`         | `string \| undefined`                                                                     | Names the trigger, with the chosen item's label after it, and the search field. Default: `"Choose"`                                                                                                                                        |
| `placeholder?`   | `string \| undefined`                                                                     | Shown in the empty search field. Default: `"Search…"`                                                                                                                                                                                      |
| `emptyText?`     | `string \| undefined`                                                                     | Shown while nothing matches the search. Default: `"No matches"`                                                                                                                                                                            |
| `backLabel?`     | `string \| undefined`                                                                     | Names the row that goes back from a page. Default: `"Back"`                                                                                                                                                                                |
| `value?`         | `string \| null \| undefined`                                                             | The chosen item's `value`. Passing it controls it: change it in `onValueChange`.                                                                                                                                                           |
| `defaultValue?`  | `string \| null \| undefined`                                                             | The chosen item's `value` at first, when `value` isn't passed. Default: `null`                                                                                                                                                             |
| `onValueChange?` | `((value: string, details: ChangeDetails<PickerValueChangeReason>) => void) \| undefined` | Called when a person or `setValue` chooses an item, with why.                                                                                                                                                                              |
| `onAction?`      | `((id: string, details: ChangeDetails<PickerValueChangeReason>) => void) \| undefined`    | Called when a person or `run` runs one of the `actions`, by its `id`. Cancel it to keep the list open.                                                                                                                                     |
| `open?`          | `boolean \| undefined`                                                                    | Whether the list is open. Passing it controls it: change it in `onOpenChange`.                                                                                                                                                             |
| `defaultOpen?`   | `boolean \| undefined`                                                                    | Whether the list is open at first, when `open` isn't passed. Default: `false`                                                                                                                                                              |
| `onOpenChange?`  | `((open: boolean, details: ChangeDetails<PickerOpenChangeReason>) => void) \| undefined`  | Called when the list opens or closes, with what caused it.                                                                                                                                                                                 |
| `presentation?`  | `"auto" \| "popover" \| "sheet"`                                                          | How the list presents. `"auto"` is a bottom sheet on small touch screens and a popover elsewhere. Default: `"auto"`                                                                                                                        |
| `disabled?`      | `boolean \| undefined`                                                                    | Whether the trigger can't open the list. Default: `false`                                                                                                                                                                                  |
| `motion?`        | `"auto" \| "none" \| "reduced"`                                                           | How the list opens and closes. `"auto"` follows `prefers-reduced-motion`. Default: `"auto"`                                                                                                                                                |
| `items?`         | `PickerItem<unknown>[] \| undefined`                                                      | The rows to choose from, grouped by their `group` in the order groups first appear. An item with `items` opens a page of them. Every `value` is unique across all pages. The primitive passes each `icon` through untouched. Default: `[]` |

Vue, Svelte and Solid take the same props. Controlled props and callbacks are spelled as each framework expects:

| React                    | Vue                              | Svelte                        | Solid                    |
| ------------------------ | -------------------------------- | ----------------------------- | ------------------------ |
| `value`, `onValueChange` | `v-model:value`, `@value-change` | `bind:value`, `onValueChange` | `value`, `onValueChange` |
| `open`, `onOpenChange`   | `v-model:open`, `@open-change`   | `bind:open`, `onOpenChange`   | `open`, `onOpenChange`   |
| `onAction`               | `@action`                        | `onAction`                    | `onAction`               |

### Agent [#agent]

An agent connected with `createAgent` finds the picker by its label and reads `open` and the chosen item's `value`. Its `setValue` takes any item on any page and refuses an unknown or disabled one. `run` takes an action's `id` and is offered only while `onAction` is set. Neither closes the list, and neither is offered while the picker is `disabled`. It needs no person to confirm.

### PickerAgentActions

| Prop       | Type                                        | Description                                                                                                                                                                            |
| ---------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `open`     | `(() => boolean) \| undefined`              | Opens the list. Offered only while it's closed and enabled. Returns whether the change was accepted.                                                                                   |
| `close`    | `(() => boolean) \| undefined`              | Closes the list. Offered only while it's open. Returns whether the change was accepted.                                                                                                |
| `setValue` | `((value: string) => boolean) \| undefined` | Chooses an item by its `value`, on any page, leaving the list as it is. Returns `false` for an unknown or disabled one, or a refused change. Offered only while the picker is enabled. |
| `run`      | `((id: string) => boolean) \| undefined`    | Runs one of the `actions` by its `id`, leaving the list as it is. Offered only while `onAction` is set and the picker is enabled.                                                      |

<Caption>
  Runs in React, Vue, Svelte, Solid and Web Components. On `<kind-picker label="Work in" can-run>`, set `items`, `actions` and `value` as properties, and listen for `pickerchange`, with the item's `value` as `event.detail.value`, `pickeraction`, with the action's `id`, and `openchange`. An item's `icon` is an image URL or an Element, which the element copies into its row. The element fills in its button and list when it has no children.
</Caption>
