Data view overview

Note: Data view lives in its own package @patternfly/react-data-view

If you notice a bug, or if you have a suggestion for improving the data view extension or its documentation, please file an issue in the react-data-view repository. Before doing so, please make sure there is not already a pre-existing issue.


The data view extension enables you to display datasets in organized layouts, with data representations and interactive toolbars for actions like selection and pagination.

Layout

A data view should contain a header, the data representation, and a footer. These parts are organized in a stack layout.

The data view toolbars and sub-components that display the data (like a card view or table) are always passed as children to the <DataView> component.

Header
Data representation
Footer

Modularity

The extension's modular architecture lets you efficiently create consistent data views, either by using predefined sub-components and hooks, or by defining your own. You can choose the tools that suit your needs and easily replace any part with a custom implementation.

The <DataViewToolbar> component extends the PatternFly toolbar to support the most common needs. For more details, refer to the data view toolbar examples. You can also use a custom toolbar component if needed for your use case.

Data can be presented using the predefined <DataViewTable> component, which is an abstraction above the PatternFly table. For more details, refer to the data view table examples. If you have more specific data display needs, you can pass a custom implementation as a <DataView> child. In the near future, we are also planning to introduce a predefined card view component.

1 - 5 of 6
Data selection table head cell
Repository oneBranch onePull request oneWorkspace oneTimestamp one
Repository twoBranch twoPull request twoWorkspace twoTimestamp two
Repository threeBranch threePull request threeWorkspace threeTimestamp three
Repository fourBranch fourPull request fourWorkspace fourTimestamp four
Repository fiveBranch fivePull request fiveWorkspace fiveTimestamp five
1 - 5 of 6

Events context

The <DataViewEventsContext> component is an advanced feature that enables external listening of data view events. In order to share data view context with your other UI components, both your components and your data view should be wrapped with the <DataViewEventsProvider>. This is demonstrated in the following example.

Row click subscription example

This example uses the <DataViewEventsProvider> to display details about a selected row in a drawer component.

Data selection table head cellRepositoriesBranchesPull requestsWorkspacesLast commit
Repository oneBranch onePull request oneWorkspace oneTimestamp one
Repository twoBranch twoPull request twoWorkspace twoTimestamp two
Repository threeBranch threePull request threeWorkspace threeTimestamp three
Repository fourBranch fourPull request fourWorkspace fourTimestamp four
Repository fiveBranch fivePull request fiveWorkspace fiveTimestamp five
Repository sixBranch sixPull request sixWorkspace sixTimestamp six

Props

DataView

extends StackProps
*required
NameTypeDefaultDescription
childrenrequiredReact.ReactNodeContent rendered inside the data view
activeStateDataViewState | stringCurrently active state
ouiaIdstringCustom OUIA ID
selectionDataViewSelectionSelection context configuration
We use cookies on our websites to deliver our online services. Details about how we use cookies and how you may disable them are set out in our Privacy Statement. By using this website you agree to our use of cookies.