Admin Dashboard Components
Introduction
A comprehensive React admin UI package for Prisma-based applications. This package provides ready-to-use components for building admin interfaces with full CRUD operations, form handling, and table management.
Installation
Dependencies
This package requires the following peer dependencies:
- React ^18.2.0
- React DOM ^18.2.0
- React Hook Form
- @apollo/client (for GraphQL operations)
Main Components
PrismaTable
The main table component for displaying and managing Prisma model data.
Configuration Example
Here's how to configure your Prisma schema for use with PalJS Admin:
Environment Configuration
Add the required environment variables to your .env
file:
Package.json Scripts
Add these scripts to your package.json
:
Settings
Configuration component for admin panel settings.
Development Server
To run your admin interface in development mode:
Types and Interfaces
TableParentRecord
Interface for parent record relationships in tables.
Column Configuration
Define table columns with sorting, filtering, and custom rendering.
Form Components
Dynamic Form Generation
Auto-generate forms based on Prisma schema definitions.
Utility Functions
classNames
Utility function for conditional CSS class names.
Advanced Usage
Custom Table Columns
Custom Actions
Pagination Configuration
Features
- Ready-to-use Components: Pre-built table, form, and settings components
- CRUD Operations: Built-in support for Create, Read, Update, Delete operations
- Form Handling: Automatic form generation based on Prisma schema
- Table Management: Advanced table features with sorting, filtering, and pagination
- Responsive Design: Mobile-friendly components
- TypeScript Support: Full TypeScript support with proper type definitions
- Customizable: Highly customizable components to match your design system