Skip to main content
Version: Next

ElementCollection

Home > @backstage/core-plugin-api > ElementCollection

A querying interface tailored to traversing a set of selected React elements and extracting data.

Signature:

export interface ElementCollection 

Remarks

Methods prefixed with selectBy are used to narrow the set of selected elements.

Methods prefixed with find return concrete data using a deep traversal of the set.

Methods prefixed with get return concrete data using a shallow traversal of the set.

Methods

Method

Description

findComponentData(query)

Finds all elements using the same criteria as selectByComponentData, but returns the actual component data of each of those elements instead.

getElements()

Returns all of the elements currently selected by this collection.

selectByComponentData(query)

Narrows the set of selected components by doing a deep traversal and only including those that have defined component data for the given key.