- Description
- Technologies
- Features
- Prerequisites
- Installation
- Component Documentation
- Development
- Authors
- License
The EmployeeTable
component is a reusable React component designed for displaying employee data in a tabular format. It includes features such as sorting, filtering, pagination, and customizable styling. This component is built with TypeScript and Vite for optimized development and build processes.
This project uses a variety of technologies and tools to build and maintain the Employee Table component:
-
React
: A JavaScript library for building user interfaces. -
React DOM
: A package that provides DOM-specific methods for React. -
TypeScript
: A strongly typed programming language that builds on JavaScript. -
Vite
: A fast build tool and development server. -
Vitest
: A fast and efficient testing framework for Vite projects. -
ESLint
: A tool for identifying and fixing problems in JavaScript and TypeScript code. -
Vite Plugin React
: A Vite plugin to support React in the development process. -
Vite Plugin CSS Injected by JS
: A plugin for injecting CSS via JavaScript in Vite projects. -
Vite Plugin DTS
: A Vite plugin for generating TypeScript declaration files. -
@typescript-eslint
: A set of tools for linting TypeScript code using ESLint. -
Node.js
: JavaScript runtime built on Chrome's V8 engine, used to manage dependencies and run scripts.
- Sorting: Clickable table headers to sort data in ascending or descending order.
- Filtering: Search bar to filter rows based on user input.
- Pagination: Control the number of rows displayed per page and navigate through pages.
- Customization: Easily customizable styles through props.
- Node.js: Version 16 or later
- Editor: Recommended editors include Visual Studio Code, WebStorm, or any editor with TypeScript support.
To use this library in your project, follow these steps:
-
Install the Package:
You can install the
employee-table
package from npm using the following command:npm install @ionutpuenaru/employee_table
Or if you're using Yarn:
yarn add @ionutpuenaru/employee_table
-
Setup:
After installation, you can use the EmployeeTable component in your React project.
Example Usage:
import React from 'react';
import { EmployeeTable } from '@ionutpuenaru/employee_table';
import { data } from './path-to-your-data';
const App = () => (
<div>
<EmployeeTable
data={data}
tableAppClassName="my-custom-table-app"
tableClassName="my-custom-table"
headerClassName="my-custom-header"
rowClassName="my-custom-row"
cellClassName="my-custom-cell"
/>
</div>
);
export default App;
-
Description:
- Renders a table with employee data, supporting sorting, filtering, and pagination.
-
Props:
-
data (
DataRow[]
): Array of data rows to be displayed in the table. -
tableAppClassName (
string
): Optional class name for the outer container of the table. -
tableClassName (
string
): Optional class name for the<table>
element. -
headerClassName (
string
): Optional class name for the table headers. -
rowClassName (
string
): Optional class name for table rows. -
cellClassName (
string
): Optional class name for table cells.
-
data (
-
Description: Represents a single row of data in the table.
-
Type:
export interface DataRow { [key: string]: string | number | Date; }
To develop and test this component locally:
-
Clone the Repository:
git clone https://github.com/PuenaruIonutMarian/EmployeeTable.git cd employee_table
-
Install Dependencies:
npm install
-
Run the Development Server:
npm run dev
-
Build for Production:
npm run build
-
Run Tests:
npm run test
Puenaru Ionut Marian
This project is licensed under the MIT License.