Skip to content

Commit da0b7b1

Browse files
authored
Merge pull request #6 from Sridhar-Karunakaran/master
Updating Readme file content
2 parents ca83e33 + 02cd6e4 commit da0b7b1

3 files changed

Lines changed: 190 additions & 24 deletions

File tree

README.md

Lines changed: 170 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,189 @@
1-
# Getting Started with React UI Components using Next.js
1+
# 📊 Getting Started React Pivot Table Component (Syncfusion EJ2) + Next.js
22

3-
This application demonstrates the usage of the Syncfusion React Pivot Table component in Next.js.
3+
[![License](https://img.shields.io/badge/license-SEE%20LICENSE%20IN%20license-blue.svg)](https://www.syncfusion.com/content/downloads/syncfusion_license.pdf)
4+
[![Nextjs](https://img.shields.io/badge/Nextjs-16.1.6-blue.svg)](https://nextjs.org/)
5+
[![Last Updated](https://img.shields.io/github/last-commit/SyncfusionExamples/syncfusion-react-pivotview-component-in-nextjs.svg)](https://github.com/SyncfusionExamples/syncfusion-react-pivotview-component-in-nextjs/commits)
6+
[![Syncfusion Version](https://img.shields.io/badge/Syncfusion%20EJ2-LTS-green.svg)](https://www.syncfusion.com/react-components/)
7+
[![Node.js](https://img.shields.io/badge/Node.js-LTS-green.svg)](https://nodejs.org/)
8+
[![npm](https://img.shields.io/badge/npm-v10%2B-blue.svg)](https://www.npmjs.com/)
49

5-
To know how to configure the Syncfusion React Pivot Table component in Next.js, refer to the [documentation](https://ej2.syncfusion.com/react/documentation/pivotview/nextjs-getting-started).
10+
A small Next.js sample showcasing how to integrate the Syncfusion React Pivot Table (PivotView) component with the Next.js App Router. This repo demonstrates a client-side `app/page.tsx` usage, sample datasource and theme imports so you can run the demo locally in minutes. 🚀
611

7-
## Clone the repository
12+
## 🔍 Quick overview
813

9-
* To clone the sample repository locally, open the command prompt in the desired location and execute the following command.
14+
- What: Example Next.js app that integrates the Syncfusion React Pivot Table (`@syncfusion/ej2-react-pivotview`).
15+
- Why: Shows how to use Syncfusion interactive components with the Next.js App Router (client components + CSS imports).
16+
- Who: Frontend developers building data-visualization dashboards using React + Next.js.
1017

11-
```sh
18+
## ✨ Key Features
1219

13-
git clone https://github.com/SyncfusionExamples/ej2-nextjs-pivotview.git
20+
| Feature | Description | Benefit |
21+
|---------|-------------|---------|
22+
| 🎯 **Field List Interface** | Dynamically add, remove, and rearrange data fields at runtime | Empowers end-users to customize reports without code modifications |
23+
| 📊 **Flexible Data Binding** | Supports relational data binding with hierarchical structures | Handle complex multi-dimensional business data |
24+
| 🧮 **Calculated Fields** | Create custom formulas combining multiple data fields | Advanced data analysis and business metric computation |
25+
| 💱 **Data Formatting** | Display values in currency, percentages, and custom formats | Professional presentation of numerical data |
26+
| ↕️ **Multi-Level Sorting** | Sort by multiple fields with ascending/descending control | Enhanced data exploration and trend analysis |
27+
| 🔗 **Advanced Filtering** | Filter by single or multiple criteria across all dimensions | Focused data analysis and drill-down exploration |
28+
| 📱 **Responsive Design** | Adapts seamlessly to desktop, tablet, and mobile screens | Universal accessibility across all devices |
29+
| 📤 **Export Functionality** | Export pivot table data to Excel and PDF formats | Generate shareable reports and archives |
30+
| 🎨 **Theme Support** | Multiple Tailwind and Bootstrap themes available | Consistent branding and visual customization |
31+
|**Performance Optimized** | Efficient rendering with virtual scrolling | Handle large datasets without performance degradation |
1432

15-
```
1633

17-
* Navigate to the project directory:
34+
## ✅ Highlights
1835

19-
```sh
20-
cd ej2-nextjs-pivotview
21-
```
36+
- Ready-to-run demo with sample `pivotData`.
37+
- Uses Syncfusion module injection (`CalculatedField`, `FieldList`).
38+
- Shows theme / CSS imports to `app/globals.css` for consistent styling.
39+
40+
## 🔧 Prerequisites
2241

23-
## Installing Packages
42+
- Node.js 18 LTS or later
43+
- npm (or yarn)
2444

25-
Install the required node modules by running the following command:
45+
## 🚀 Quick start
2646

27-
```sh
47+
Clone, install and run the app locally:
48+
49+
```bash
50+
git clone https://github.com/SyncfusionExamples/syncfusion-react-pivotview-component-in-nextjs
51+
cd syncfusion-react-pivotview-component-in-nextjs
2852
npm install
53+
npm run dev
2954
```
3055

31-
## Run the application
56+
Open http://localhost:3000 to view the running sample.
3257

33-
To run the application, use the following command:
58+
---
59+
60+
## 📁 What’s included
61+
62+
- `app/datasource.tsx` — sample `pivotData` used by the demo.
63+
- `app/page.tsx` — client component mounting `PivotViewComponent` and injecting services.
64+
- `app/globals.css` — recommended place to add Syncfusion theme CSS imports.
65+
66+
## 🔌 How this sample was prepared (key steps)
67+
68+
1. Install the Syncfusion PivotView package:
3469

3570
```bash
36-
npm run dev
71+
npm install @syncfusion/ej2-react-pivotview --save
3772
```
73+
74+
2. Import Syncfusion theme CSS into `app/globals.css` (example Tailwind3 theme imports):
75+
76+
```css
77+
@import '../node_modules/@syncfusion/ej2-base/styles/tailwind3.css';
78+
@import '../node_modules/@syncfusion/ej2-buttons/styles/tailwind3.css';
79+
@import '../node_modules/@syncfusion/ej2-dropdowns/styles/tailwind3.css';
80+
@import '../node_modules/@syncfusion/ej2-grids/styles/tailwind3.css';
81+
@import '../node_modules/@syncfusion/ej2-inputs/styles/tailwind3.css';
82+
@import '../node_modules/@syncfusion/ej2-lists/styles/tailwind3.css';
83+
@import '../node_modules/@syncfusion/ej2-navigations/styles/tailwind3.css';
84+
@import '../node_modules/@syncfusion/ej2-popups/styles/tailwind3.css';
85+
@import '../node_modules/@syncfusion/ej2-splitbuttons/styles/tailwind3.css';
86+
@import '../node_modules/@syncfusion/ej2-calendars/styles/tailwind3.css';
87+
@import '../node_modules/@syncfusion/ej2-react-pivotview/styles/tailwind3.css';
88+
/* add other component CSS as needed */
89+
```
90+
91+
3. Make `app/page.tsx` a client component and mount `PivotViewComponent`:
92+
93+
```tsx
94+
'use client'
95+
import { CalculatedField, FieldList, Inject, PivotViewComponent } from '@syncfusion/ej2-react-pivotview';
96+
import { DataSourceSettingsModel } from '@syncfusion/ej2-pivotview/src/model/datasourcesettings-model';
97+
import { pivotData } from './datasource';
98+
99+
export default function Home() {
100+
const dataSourceSettings: DataSourceSettingsModel = {
101+
columns: [{ name: 'Year', caption: 'Production Year' }, { name: 'Quarter' }],
102+
dataSource: pivotData as any[],
103+
expandAll: false,
104+
filters: [],
105+
drilledMembers: [{ name: 'Country', items: ['Germany'] }],
106+
formatSettings: [{ name: 'Amount', format: 'C0' }],
107+
rows: [{ name: 'Country' }, { name: 'Products' }],
108+
values: [{ name: 'Sold', caption: 'Units Sold' }, { name: 'Amount', caption: 'Sold Amount' }]
109+
};
110+
111+
return (
112+
<>
113+
<h2>Syncfusion React Pivot Table Component</h2>
114+
<PivotViewComponent id='PivotView' height={350} dataSourceSettings={dataSourceSettings} allowCalculatedField={true} showFieldList={true}><Inject services={[CalculatedField, FieldList]} />
115+
</PivotViewComponent>
116+
</>
117+
)
118+
}
119+
```
120+
121+
4. Provide sample `pivotData` in `app/datasource.tsx` (array of objects) — the demo ships with this file.
122+
123+
---
124+
125+
## ⚙️ Configuration & customization
126+
127+
- Theme: Swap the Tailwind3 CSS imports to a different Syncfusion theme file if you prefer (e.g., `fabric.css`, `material.css`).
128+
- Localization: Use Syncfusion localization utilities if needed.
129+
- Lazy-loading: Consider dynamic imports for PivotView if server-side rendering is used elsewhere.
130+
131+
## 🧩 Files structure (important files)
132+
133+
- `app/datasource.tsx` — sample data
134+
- `app/page.tsx` — demo page (client component)
135+
- `app/globals.css` — place to import Syncfusion themes
136+
- `next.config.js`, `package.json`, `tsconfig.json` — project configs
137+
138+
---
139+
140+
## 🛠 Troubleshooting
141+
142+
- If components don’t style correctly, ensure the theme CSS is imported into `app/globals.css` and there are no conflicting global rules.
143+
- If interactive features fail, verify `app/page.tsx` includes `'use client'` at the top.
144+
145+
---
146+
147+
## 🤝 Contributing
148+
149+
We welcome contributions! Here's how you can help:
150+
151+
1. **Fork** the repository
152+
2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)
153+
3. **Commit** your changes (`git commit -m 'Add amazing feature'`)
154+
4. **Push** to the branch (`git push origin feature/amazing-feature`)
155+
5. **Open** a Pull Request
156+
157+
---
158+
159+
## 📜 License & Support
160+
161+
### License
162+
163+
This project is licensed under the **Syncfusion Community License**. See the [Syncfusion License](https://www.syncfusion.com/content/downloads/syncfusion_license.pdf) for details.
164+
165+
### Support & Resources
166+
167+
- 📚 **Official Documentation:** [Syncfusion React PivotView](https://ej2.syncfusion.com/react/documentation/pivotview/nextjs-getting-started)
168+
- 🎬 **Video Tutorials:** [Syncfusion YouTube Channel](https://www.youtube.com/c/SyncfusionInc)
169+
- 💬 **Support Forum:** [Syncfusion Support](https://www.syncfusion.com/forums/react-js2)
170+
- 🐛 **Report Issues:** [GitHub Issues](https://github.com/SyncfusionExamples/syncfusion-react-pivotview-component-in-nextjs/issues)
171+
- 📧 **Contact Us:** support@syncfusion.com
172+
173+
### Additional Resources
174+
175+
- 🔗 [Syncfusion React Components](https://www.syncfusion.com/react-components/)
176+
- 📖 [Syncfusion Community](https://www.syncfusion.com/forums/react-js2)
177+
- 🎯 [Demo Sample](https://ej2.syncfusion.com/nextjs/demos/tailwind3/pivot-table/overview)
178+
179+
---
180+
181+
## ⚡ Performance Tips
182+
183+
- ✅ Use **virtual scrolling** for large datasets (1000+ rows)
184+
- ✅ Enable **lazy loading** for remote data sources
185+
- ✅ Optimize **format settings** to reduce rendering overhead
186+
- ✅ Use **filter and drill-down** to reduce data volume displayed
187+
- ✅ Consider **server-side aggregation** for very large datasets
188+
189+
---

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@types/react-dom": "18.2.7",
1616
"eslint": "8.46.0",
1717
"eslint-config-next": "13.4.13",
18-
"next": "^14.2.15",
18+
"next": "^16.1.6",
1919
"react": "18.2.0",
2020
"react-dom": "18.2.0",
2121
"typescript": "5.1.6"

tsconfig.json

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": ["dom", "dom.iterable", "esnext"],
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
59
"allowJs": true,
610
"skipLibCheck": true,
711
"strict": true,
@@ -12,17 +16,27 @@
1216
"moduleResolution": "bundler",
1317
"resolveJsonModule": true,
1418
"isolatedModules": true,
15-
"jsx": "preserve",
19+
"jsx": "react-jsx",
1620
"incremental": true,
1721
"plugins": [
1822
{
1923
"name": "next"
2024
}
2125
],
2226
"paths": {
23-
"@/*": ["./src/*"]
27+
"@/*": [
28+
"./src/*"
29+
]
2430
}
2531
},
26-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
27-
"exclude": ["node_modules"]
32+
"include": [
33+
"next-env.d.ts",
34+
"**/*.ts",
35+
"**/*.tsx",
36+
".next/types/**/*.ts",
37+
".next/dev/types/**/*.ts"
38+
],
39+
"exclude": [
40+
"node_modules"
41+
]
2842
}

0 commit comments

Comments
 (0)