Migration Guide: v2.4.1
This guide will help you migrate from v2.4.0 to v2.4.1, which introduces enhanced column editor features, a unified icons API, and some breaking changes.
What's New in v2.4.1
- Drag & Drop Column Reordering - Reorder columns directly in the column editor
- Column Search - Built-in search functionality in the column editor
- Unified Icons API - New
iconsprop for cleaner icon configuration - Enhanced Column Editor Config - New
columnEditorConfigprop with comprehensive options
Breaking Changes
Removed: columnEditorPosition
The columnEditorPosition prop has been removed. The column editor now uses an optimized default position.
❌ Before (v2.4.0):
1<SimpleTable2 editColumns={true}3 columnEditorPosition="right"4 // ... other props5/>
✅ After (v2.4.1):
1<SimpleTable2 editColumns={true}3 // columnEditorPosition removed - uses optimized default4 // ... other props5/>
Deprecated Props (Still Work, But Update Recommended)
The following props are deprecated and will show console warnings in development mode. They still work in v2.4.1 but will be removed in a future version.
1. columnEditorText → columnEditorConfig
The columnEditorText prop is now part of the more comprehensive columnEditorConfig object.
❌ Before (Deprecated):
1<SimpleTable2 editColumns={true}3 columnEditorText="Customize Columns"4 // ... other props5/>
✅ After (v2.4.1):
1<SimpleTable2 editColumns={true}3 columnEditorConfig={{4 text: "Customize Columns",5 searchEnabled: true, // NEW: Enable search (default: true)6 searchPlaceholder: "Search columns...", // NEW: Custom placeholder7 }}8 // ... other props9/>
2. Individual Icon Props → icons Object
All individual icon props have been consolidated into a single icons object for better organization.
Deprecated props: expandIcon, filterIcon, headerCollapseIcon, headerExpandIcon, nextIcon, prevIcon, sortDownIcon, sortUpIcon
❌ Before (Deprecated):
1import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";2import {3 faChevronRight,4 faFilter,5 faCaretUp,6 faCaretDown,7 faAngleLeft,8 faAngleRight,9 faChevronDown10} from "@fortawesome/free-solid-svg-icons";1112<SimpleTable13 expandIcon={<FontAwesomeIcon icon={faChevronRight} />}14 filterIcon={<FontAwesomeIcon icon={faFilter} />}15 sortUpIcon={<FontAwesomeIcon icon={faCaretUp} />}16 sortDownIcon={<FontAwesomeIcon icon={faCaretDown} />}17 nextIcon={<FontAwesomeIcon icon={faAngleRight} />}18 prevIcon={<FontAwesomeIcon icon={faAngleLeft} />}19 headerExpandIcon={<FontAwesomeIcon icon={faChevronRight} />}20 headerCollapseIcon={<FontAwesomeIcon icon={faChevronDown} />}21 // ... other props22/>
✅ After (v2.4.1):
1import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";2import {3 faChevronRight,4 faFilter,5 faCaretUp,6 faCaretDown,7 faAngleLeft,8 faAngleRight,9 faChevronDown,10 faGripVertical // NEW: For drag handle11} from "@fortawesome/free-solid-svg-icons";1213<SimpleTable14 icons={{15 expand: <FontAwesomeIcon icon={faChevronRight} />,16 filter: <FontAwesomeIcon icon={faFilter} />,17 sortUp: <FontAwesomeIcon icon={faCaretUp} />,18 sortDown: <FontAwesomeIcon icon={faCaretDown} />,19 next: <FontAwesomeIcon icon={faAngleRight} />,20 prev: <FontAwesomeIcon icon={faAngleLeft} />,21 headerExpand: <FontAwesomeIcon icon={faChevronRight} />,22 headerCollapse: <FontAwesomeIcon icon={faChevronDown} />,23 drag: <FontAwesomeIcon icon={faGripVertical} />, // NEW!24 }}25 // ... other props26/>
New Features
Column Search in Editor
The column editor now includes built-in search functionality. Users can quickly find columns by typing in the search box.
1<SimpleTable2 editColumns={true}3 columnEditorConfig={{4 text: "Columns",5 searchEnabled: true, // Enable search (default: true)6 searchPlaceholder: "Find a column...", // Custom placeholder7 searchFunction: (header, searchTerm) => { // Optional: custom search logic8 return header.label.toLowerCase().includes(searchTerm.toLowerCase());9 }10 }}11 // ... other props12/>
Learn more in the Column Editing documentation.
Drag & Drop Column Reordering
Users can now reorder columns by dragging them within the column editor. This works alongside the existing header drag-and-drop functionality.
No configuration needed! Drag-and-drop in the column editor is automatically enabled when editColumns=.
Custom Drag Icon
Customize the drag handle icon in the column editor using the new icons.drag property.
1import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";2import { faGripVertical } from "@fortawesome/free-solid-svg-icons";34<SimpleTable5 editColumns={true}6 icons={{7 drag: <FontAwesomeIcon icon={faGripVertical} className="text-gray-500" />,8 }}9 // ... other props10/>
Complete Migration Example
Here's a complete before and after example showing all the changes:
❌ Before (v2.4.0):
1import { SimpleTable } from "simple-table-core";2import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";3import {4 faChevronRight,5 faFilter,6 faCaretUp,7 faCaretDown8} from "@fortawesome/free-solid-svg-icons";910<SimpleTable11 defaultHeaders={headers}12 rows={data}13 editColumns={true}14 columnEditorText="Customize Columns"15 columnEditorPosition="right"16 expandIcon={<FontAwesomeIcon icon={faChevronRight} />}17 filterIcon={<FontAwesomeIcon icon={faFilter} />}18 sortUpIcon={<FontAwesomeIcon icon={faCaretUp} />}19 sortDownIcon={<FontAwesomeIcon icon={faCaretDown} />}20/>
✅ After (v2.4.1):
1import { SimpleTable } from "simple-table-core";2import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";3import {4 faChevronRight,5 faFilter,6 faCaretUp,7 faCaretDown,8 faGripVertical9} from "@fortawesome/free-solid-svg-icons";1011<SimpleTable12 defaultHeaders={headers}13 rows={data}14 editColumns={true}15 columnEditorConfig={{16 text: "Customize Columns",17 searchEnabled: true,18 searchPlaceholder: "Search columns...",19 }}20 icons={{21 expand: <FontAwesomeIcon icon={faChevronRight} />,22 filter: <FontAwesomeIcon icon={faFilter} />,23 sortUp: <FontAwesomeIcon icon={faCaretUp} />,24 sortDown: <FontAwesomeIcon icon={faCaretDown} />,25 drag: <FontAwesomeIcon icon={faGripVertical} />,26 }}27/>
New CSS Classes and Variables
If you're using custom CSS, you can now style the new column editor features:
New CSS Classes:
.st-column-editor-search-wrapper- Search input container.st-column-editor-search- Search input wrapper.st-column-editor-list- Column list container.st-column-label-container- Column label wrapper.st-drag-icon-container- Drag handle container.st-column-editor-drag-separator- Drag drop indicator line
New CSS Variables:
--st-drag-separator-color- Color of the drag drop indicator (theme-specific)
Learn more in the Custom Theme documentation.
Migration Checklist
- ☐Remove
columnEditorPositionprop - ☐Replace
columnEditorTextwithcolumnEditorConfig - ☐Consolidate individual icon props into
iconsobject - ☐Test column editor search functionality
- ☐Test drag-and-drop column reordering in column editor
- ☐Update custom CSS if using column editor styles
Need Help?
If you encounter any issues during migration, check out these resources: