Skip to content

Commit

Permalink
Sections for filters and actions
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Oct 19, 2023
1 parent 8f65e35 commit 07f72e9
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions packages/edit-site/src/components/dataviews/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# DataView

This file aims to document the main APIs related to the DataView component.
This file aims to document the main APIs related to the DataViews component, which aims to provide an API to render datasets using different views (table, grid, etc.).

```js
<DataViews
data={ pages }
isLoading= { isLoadingPages }
view={ view }
onChangeView={ onChangeView }
fields={ fields }
filters={ filters }
actions={ [ trashPostAction ] }
paginationInfo={ { totalItems, totalPages } }
/>
```

## View

Expand Down Expand Up @@ -92,18 +105,12 @@ The fields describe the dataset. For example:
- `resetLabel`: the label for the reset option of the filter. If none provided, `All` is used.
- `resetValue`: the value for the reset option of the filter. If none provedid, `''` is used.
## DataViews
## Filters
The UI component responsible for rendering the dataset.
Global vs Field filters.
```js
<DataViews
data={ pages }
isLoading= { isLoadingPages }
fields={ fields }
view={ view }
onChangeView={ onChangeView }
actions={ [ trashPostAction ] }
paginationInfo={ { totalItems, totalPages } }
/>
```
Shape of the filter.
## Actions
Record actions.

0 comments on commit 07f72e9

Please sign in to comment.