---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
  - property: og:type
    content: article
  - property: article:section
    content: Plugin platform
  - property: og:title
    content: MetaEntitiesSelect
  - property: article:tag
    content: Техническая инструкция
alternate:
  - https://yandex.ru/support/tracker/en/plugins/components/meta-entities-select.md
  - https://yandex.ru/support/tracker/ru/plugins/components/meta-entities-select.md
  - href: en/plugins/components/meta-entities-select.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/support/tracker/en/llms.txt

[← Back to components list](https://yandex.ru/support/tracker/en/plugins/components/index.md)

# MetaEntitiesSelect {#meta-entities-select}

A component for selecting Tracker meta-entities — projects, portfolios, goals, reports — based on a suggest. Displays each entity with an icon and name, supports asynchronous loading, loading state, error display, and a clear button.

## Basic usage {#usage}

```tsx
import {MetaEntitiesSelect} from '@weavix/tracker-components';

<MetaEntitiesSelect
    getItems={(text) => fetchProjects(text)}
    onChange={(entity) => console.log('selected', entity)}
/>;
```

## Usage with Tracker API {#tracker-api}

```tsx
import React, {useState} from 'react';
import {MetaEntitiesSelect} from '@weavix/tracker-components';
import type {MetaEntityV2} from '@weavix/tracker-api-types';

interface Props {
    trackerApi: TrackerApi;
    onChange: (entity: MetaEntityV2) => void;
}

export const ProjectSelect: React.FC<Props> = ({trackerApi, onChange}) => {
    const [error, setError] = useState<string | undefined>(undefined);

    const getItems = async (input: string): Promise<MetaEntityV2[]> => {
        setError(undefined);
        try {
            const result = await trackerApi.v3.post['/entities/{entityType}/_search']({
                pathParams: {entityType: 'project'},
                queryParams: {fields: ['summary'], page: 1, perPage: 50},
                bodyParams: {filter: {}, filterTypes: ['ALL'], input},
            });
            return result.data;
        } catch (err) {
            setError(err instanceof Error ? err.message : 'Failed to load projects');
            return [];
        }
    };

    return (
        <MetaEntitiesSelect
            getItems={getItems}
            onChange={onChange}
            error={error}
            placeholder="Select project"
        />
    );
};
```

> **Entity types:** the `entityType` parameter accepts values `'portfolio' | 'project' | 'report' | 'goal'`.

## Main props {#props}

#|
|| **Prop** | **Type** | **Default** | **Description** ||
|| `getItems`
|

```ts
(text: string) =>
  MetaEntityV2[]
  | Promise<MetaEntityV2[]>
```

| — | Function for loading items. Called on mount and on every text change ||
|| `onChange`
|

```ts
(entity: MetaEntityV2) =>
  void
```

| — | Callback when an entity is selected ||
|| `onTextChange`
|

```ts
(text: string) =>
  void
```

| — | Callback when the input field text changes ||
|| `text` | `string` | — | Current input field value (controlled mode) ||
|| `placeholder` | `string` | `'Select project'` | Placeholder for an empty field ||
|| `error` | `string | boolean` | — | Error message or error flag ||
|| `hasClear` | `boolean` | `true` | Show clear button (×) ||
|| `className` | `string` | — | Additional CSS class for the root element ||
|| `itemClassName` | `string` | — | Additional CSS class for each list item ||
|#
