Skip to content

Entity picker ​

A dialog with a list of entities to choose from, to link them to the entity you are working on.

modals-entitypicker--defaultOpen in Storybook ↗

When to use ​

  • Linking existing records to the one you have open: Add existing assets on an asset's list or media block.
  • Choosing records in a step of a guided flow.
  • People need filters, sorting or a preview to find the right records.

When not to use ​

Anatomy ​

  1. Dialog: a wide modal, titled by the action that opened it: Add existing {type}.
  2. List bar: the Filters button, the result count and the sort controls. Filters opens the filter panel beside the list.
  3. Selection bar: the number selected and Confirm selection (commit). The button is disabled until something is selected.
  4. List: list rows with a checkbox, a thumbnail, the title and the configured columns. The header checkbox selects the page. When the type has a preview, the eye opens it.
  5. Highlight chip (optional): a label on rows the flow marks as current, with --chip-padding and --color-accent-wash.

Variants ​

VariantWhereBehaviour
FiltersdefaultFilters button and filter panel; the list follows the filters
Searchconfigured per field or stepa search bar above the list instead of filters
Links on confirmform dialog, e.g. Add existing assetsConfirm selection saves the links, closes the dialog and refreshes the list
Hands back on confirmguided flow stepConfirm selection hands the selection to the flow and clears it; nothing is saved yet
modals-entitypicker--filters-openOpen in Storybook ↗
modals-entitypicker--search-modeOpen in Storybook ↗

In search mode the search runs as you type, 250 ms after the last key, or at once on Enter. It searches the metadata fields the configuration names. In search mode the picker is --entity-picker-height tall in a modal and --entity-picker-drawer-height in a drawer.

States ​

StateWhat you seeTrigger
Nothing selectedConfirm selection disabledopening
Selectedchecked rows with a wash, Selection: {n}, Confirm selection enabledchecking rows
Already linkedthe row is greyed out and has no checkboxthe entity is already linked to the open entity
Limit reachedthe other rows' checkboxes are disabledthe configured maximum is selected
No resultsNo results match your filters with a tip; in search mode No results foundnothing matches
modals-entitypicker--selectedOpen in Storybook ↗
modals-entitypicker--already-linkedOpen in Storybook ↗

After Confirm selection in a form dialog:

  1. Open edits on the entity are saved first. If they have errors, the dialog closes and a warning says Saving failed.
  2. The selected entities are linked, or they replace the existing links of that type when the action is set to replace.
  3. The dialog closes, the new rows show in the list at once and the change is saved.
  4. A notification confirms the save and the list reloads. If the save fails, the dialog opens again.

Keyboard & accessibility ​

  • The dialog follows the modal: focus starts on the close button, Escape closes it, and the title names it.
  • Tab moves through the list bar, the selection bar and the rows. Space checks a row's checkbox.
  • Rows that are already linked have no checkbox, so they are skipped.
  • The selection count is role="status", so a new count is announced.
  • The search bar is labelled Search.

Content ​

  • Title the dialog by the action: Add existing assets, not Entity picker.
  • Keep the highlight label short: one or two words.
  • Translation keys: bulk-operations.add-existing-relation, bulk-operations.confirm-selection.

Quick search from a relation field ​

While you edit a relation field, Browse… under the field opens a smaller search dialog. It searches the field's type and puts the chosen entities in the field, which saves like any other inline edit.

modals-relationpicker--multipleOpen in Storybook ↗
  1. Header: the title Choose {type}, a count chip Results: {n} (--chip-padding) and the close button.
  2. Search pill: search icon, input and, while results load, a spinner.
  3. Results: a fixed-height area (--relation-picker-results-height), so the dialog keeps its size while you type. A selected row has --color-accent-wash and a check in --color-commit.
  4. Footer (multiple only): Cancel and Add, padded with --modal-footer-pad.

From 48rem up the dialog is --relation-picker-width wide. For a single-select field, choosing a row picks it and closes the dialog; there is no footer. The search runs as you type, 250 ms after the last key, and lists the first page of results. When nothing matches and the field allows new entities, Create '{query}' closes the dialog and starts the field's own create flow.

modals-relationpicker--no-resultsOpen in Storybook ↗
KeyIn the search pillOn a row
↓first rownext row
↑—previous row; from the first row back to the search pill
Enter / Space—chooses the row
Escapecloses the dialogcloses the dialog

Focus starts in the search pill. The results are a listbox (aria-multiselectable when multiple), each row an option with aria-selected. Keys: inline-edit.browse, inline-edit.browse-title, inline-edit.picker-*.

Modal · Filter panel · Entity list element · Selection action bar · Autocomplete · Guided flow

Powered by Elody - Open Source Semantic Data Platform