JD Retail Open-Sources DripTable: Schema-Driven List Rendering for React Admin Panels
Table of Contents
- Advantages
- When to Use
- Getting Started
- Configuration Side
- Application Side
- Open Source Repository
DripTable is a dynamic list solution for enterprise-level back-office systems, launched by JD Retail. The project is based on React and JSON Schema, aiming to quickly generate dynamic list pages through simple configuration, thereby reducing the difficulty of list development and improving work efficiency.
DripTable currently includes the following sub-projects: drip-table and drip-table-generator. The details of each sub-project are as follows:
- drip-table: The core library of the dynamic list solution. Its main capability is to support automatic rendering of list content from data that conforms to JSON Schema standards.
- drip-table-generator: A visual tool used to generate configuration data that conforms to JSON Schema standards for DripTable.
Advantages
- Efficient Development: Improves front-end list development efficiency and implements low-code rapid development of list pages.
- Config-Driven Rendering: Uses simple JSON Schema configuration fields to automatically render the required list, lowering the user's usage cost.
- Dynamic Extensibility: Supports custom component development, quickly generating custom or business-oriented cell components via an API.
- Flexible UI Framework: The table interface framework supports multiple theme packages and also supports custom theme packages.
When to Use
- Used for rapid construction of back-office CMS list pages; a list can be generated from simple JSON Schema data without hard-coding.
- Used for front-end table preview and implementation in low-code list building, enabling custom lists without complex front-end code.
DripTable list building example
DripTable list building example
Getting Started
DripTable has two application scenarios: the configuration side and the application side. The configuration side is mainly responsible for generating JSON Schema standard data through visual and low-code methods. The application side renders that JSON Schema configuration data into dynamic lists.
Configuration Side
1 Installing Dependencies
The configuration side depends on the application side. Make sure drip-table is installed first.
"yarn"
yarn add drip-table-generator
"npm"
npm install --save drip-table-generator
2 Import Dependencies at the Top of the File
import DripTableGenerator from "drip-table-generator";
import "drip-table-generator/dist/index.min.css";
3 Reference in the Page
return <DripTableGenerator />;
The normal rendering effect of the configuration side is as follows:
Normal rendering effect of the configuration side
Application Side
1 Installing Dependencies
Install drip-table:
"yarn"
yarn add drip-table
"npm"
npm install --save drip-table
2 Import Dependencies at the Top of the File
// Import drip-table
import DripTable from "drip-table";
// Import drip-table styles
import "drip-table/dist/index.min.css";
3 Reference
const schema = {
size: "middle",
columns: [
{
key: "columnKey",
title: "列标题",
dataIndex: "dataIndexName",
component: "text",
options: {
mode: "single",
},
},
],
};
return (
<DripTable
schema={schema}
dataSource={[]}
/>
);
The normal rendering effect of the application side is as follows:
Normal rendering effect of the application side
Top 1 from juejin.cn, machine-translated. The original thread is authoritative.
This library is no longer maintained, right?