Table Props
Complete guide to TableGrid component props with examples
Table Props Guide 📚
This guide explains all the props you can use with the TableGrid
component. We'll start with the basic props and move on to more advanced ones.
Essential Props
These are the props you'll use most often:
columns
The list of columns to show in your table.
- Type:
Column<T>[]
- Required: ✅
data
The data to display in your table.
- Type:
T[]
- Required: ✅
variant
Choose how your table looks.
- Type:
"modern" | "minimal" | "classic"
- Default:
"modern"
- Required: ❌
maxHeight
Set how tall your table can be.
- Type:
string
- Required: ❌
Search and Filter Props
enableFiltering
Turn on search functionality.
- Type:
boolean
- Default:
false
fuzzySearchKeys
Which fields to search in.
- Type:
Array<keyof T | string>
- Required: Only if
enableFiltering
is true
fuzzySearchThreshold
How strict the search should be (0 to 1).
- Type:
number
- Default:
0.3
Column Management Props
enableColumnResize
Let users resize columns.
- Type:
boolean
- Default:
false
columnResizeMode
When to update column sizes.
- Type:
"onChange" | "onResize"
- Default:
"onChange"
columnResizeDirection
Which way columns resize.
- Type:
"ltr" | "rtl"
- Default:
"ltr"
Virtual Scrolling Props
virtualization
Settings for handling large data efficiently.
Server-Side Props
serverSide
Settings for loading data from a server.
Styling Props
styleConfig
Customize how your table looks.
Custom Component Props
components
Replace default parts with your own components.
Event Props
events
Handle table events like sorting and filtering.
State Props
state
Control the table's state from outside.
Ref Props
ref
Access table methods like scrolling.
Best Practices 💡
- Start Simple: Begin with just
columns
anddata
- Add Features Gradually: Add more props as you need them
- Use TypeScript: Get better autocomplete and catch errors early
- Handle Loading: Always show loading states when fetching data
- Style Consistently: Use
styleConfig
for consistent looks - Test Thoroughly: Test all interactive features
- Consider Mobile: Make sure your table works on small screens
Last updated on