This is a React app that provides a customizable grid component with various functionalities such as search, column sorting, infinite scroll, responsive layout, themes, and column pinning. The grid component expects two props: Table Config and Table Data.
To run this React app locally, please follow these steps:
- Clone the repository:
git clone <repository_url>
- Navigate to the project directory:
cd react-grid-app
- Install the dependencies:
npm install
- Start the development server:
npm start
- Open your browser and visit
http://localhost:3000
to view the app.
The table component is a reusable component that can be easily integrated into any React application. It provides the following functionalities:
- Search: Allows searching and filtering the grid data based on user input.
- Column Sorting: Enables sorting the grid data by clicking on the column headers.
- Infinite Scroll: Implements infinite scrolling using the React Virtuoso package, providing a smooth scrolling experience with optimal performance.
- Responsive Layout: The grid adjusts its height and width based on the viewport size, ensuring a responsive design.
- Theme: Supports a dark/light theme for enhanced visual appeal and user experience.
- Column Pinning: Allows pinning columns on the left side of the grid for easy reference and visibility.
To use the grid component in your React application, follow these steps:
- Import the Grid component:
import Grid from './components/TableComponent';
- Pass the Grid Config Info and Grid Data as props to the Grid component:
<TableComponent
config={{headerData,
pinnable,
searchable,
sortable,
theme,
}}
data={gridData}
/>
- Customize the Config Info object and provide the necessary configurations for the Table component, such as column definitions, sorting options, and pinning settings.
- Provide the Data as an array of objects containing the actual data to be displayed in the Table.
The following dependencies are used in this React app:
- axios: ^1.4.0
- lodash: ^4.17.21
- react: ^18.2.0
- react-dom: ^18.2.0
- react-icons: ^4.8.0
Please refer to the package.json file for the specific versions of these dependencies used in the app.