Shopware Design

Entity Select

Source

Usage

Entity Select is a repository-backed select that loads its options from an Admin SDK entity repository. Use it when options should come from a repository and you want built-in search and pagination for the results, or when an existing modelValue should be hydrated to a visible selected label.

import { MtEntitySelect } from "@shopware-ag/meteor-component-library";

Examples

With initial value

Multi-selection

Disabled

API reference

Props

PropTypeDefault
entity *keyof EntitySchema.Entities
repository(<EntityName extends keyof EntitySchema.Entities>(entityName: EntityName) => { search: (criteria: default, context?: ApiContext | undefined) => Promise<default<EntityName> | null>; get: (id: string, context?: ApiContext | undefined, criteria?: default | undefined) => Promise<Entity<EntityName> | null>; save: (entity: Entity<EntityName>, context?: ApiContext | undefined) => Promise<void | null>; clone: (entityId: string, contextOrBehavior?: any, behaviorOrContext?: any) => Promise<unknown>; hasChanges: (entity: Entity<EntityName>) => Promise<boolean | null>; saveAll: (entities: default<EntityName>, context?: ApiContext | undefined) => Promise<unknown>; delete: (entityId: string, context?: ApiContext | undefined) => Promise<void | null>; create: (context?: ApiContext | undefined, entityId?: string | undefined) => Promise<Entity<EntityName> | null>; }) | undefinedundefined
model-valueanynull
label-propertystring | string[]"name"
value-propertystring"id"
disabledbooleanfalse
enable-multi-selectionbooleanfalse

Events

EventPayload
update:modelValue[value: any]

Best practices

Do
  • Pass entity for the default repository lookup.
  • Use repository only when you need custom fetching behavior.
  • Keep labelProperty and valueProperty aligned with the entity shape you want to show and store.
Don't
  • Do not use it when options are already available locally.
  • Do not duplicate search or pagination in the parent component.
  • Do not assume modelValue stores the whole entity by default.

Behavior

  • The first page loads on mount.
  • Search is handled through repository term lookups.
  • modelValue stores the selected valueProperty, which defaults to id.

Accessibility

  • Use a clear visible field label so users understand what entity they are selecting.
  • Keep result labels distinct so search results stay easy to understand.
  • Select: when options come from local or externally managed lists.