Skip to content

Commit 0270881

Browse files
author
Anuj Rajak
committed
review comments
1 parent e4835ff commit 0270881

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ This npm package provides a collection of reusable Patternfly React components t
1313
- ImageComponent
1414
- OneCardWrapper
1515
- TableWrapper
16-
- Dynamic Component Renderer
17-
- DynamicComponents
1816

1917
## Installation
2018

@@ -82,6 +80,48 @@ function App() {
8280
}
8381
```
8482

83+
### Table Component
84+
85+
```jsx
86+
import { DynamicComponent } from "@rhngui/patternfly-react-renderer";
87+
88+
const tableConfig = {
89+
component: "table",
90+
title: "Movie Statistics",
91+
id: "movie-stats-table",
92+
fields: [
93+
{
94+
name: "Movie Title",
95+
data_path: "movies.title",
96+
data: ["Toy Story", "Finding Nemo", "The Incredibles"],
97+
},
98+
{
99+
name: "Release Year",
100+
data_path: "movies.year",
101+
data: [1995, 2003, 2004],
102+
},
103+
{
104+
name: "Genres",
105+
data_path: "movies.genres",
106+
data: [
107+
["Animation", "Adventure"],
108+
["Animation", "Adventure"],
109+
["Animation", "Action"],
110+
],
111+
},
112+
{
113+
name: "Rating",
114+
data_path: "movies.rating",
115+
data: [8.3, 8.1, 8.0],
116+
},
117+
],
118+
};
119+
120+
function App() {
121+
return <DynamicComponent config={tableConfig} />;
122+
}
123+
```
124+
85125
## Links
86126

87127
- [Documentation](https://redhat-ux.github.io/next-gen-ui-agent/guide/renderer/patternfly_npm/)

src/components/TableWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Card, CardBody, CardHeader, CardTitle } from "@patternfly/react-core";
1+
import { Card, CardBody } from "@patternfly/react-core";
22
import {
33
Table,
44
Thead,

0 commit comments

Comments
 (0)