Skip to content

Commit edbe70b

Browse files
feat: Add example project
1 parent 53b3142 commit edbe70b

File tree

17 files changed

+5063
-0
lines changed

17 files changed

+5063
-0
lines changed

example/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

example/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Multi-Level Table Example
2+
3+
This is an example project demonstrating the usage of `@keyvaluesystems/material-table-component`.
4+
5+
## Features Demonstrated
6+
7+
- Multi-level data display
8+
- Custom column rendering
9+
- Row selection
10+
- Sorting
11+
- Filtering
12+
- Pagination
13+
- Theme customization
14+
15+
## Getting Started
16+
17+
1. Install dependencies:
18+
```bash
19+
npm install
20+
```
21+
22+
2. Start the development server:
23+
```bash
24+
npm run dev
25+
```
26+
27+
3. Open [http://localhost:5173](http://localhost:5173) to view the example in your browser.
28+
29+
## Project Structure
30+
31+
- `src/App.tsx` - Main application component with table implementation
32+
- `src/App.css` - Styles for the example
33+
- `src/main.tsx` - Application entry point
34+
35+
## Example Features
36+
37+
The example demonstrates:
38+
39+
1. **Data Structure**
40+
- Three levels of nested data
41+
- Parent-child relationships
42+
- Various data types (string, number)
43+
44+
2. **Column Configuration**
45+
- Custom rendering for status column
46+
- Filterable columns
47+
- Formatted value display
48+
49+
3. **Theme Customization**
50+
- Custom colors
51+
- Nested level styling
52+
- Component-specific styling
53+
54+
4. **Interactive Features**
55+
- Row selection
56+
- Sorting
57+
- Filtering
58+
- Pagination
59+
60+
## Learn More
61+
62+
For more information about the component, visit the [main documentation](../../README.md).

example/eslint.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)

example/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)