Last Updated: 2026-01-17
Status: ✅ Active
Overview
This guide provides best practices for implementing tables in the Encore OS platform using the@/platform/table-v2 framework.
Quick Decision Guide
Which Component to Use?
When to Use Virtualization
Use virtualization when:- Row count exceeds 500+
- Users frequently load full datasets
- Performance is degrading on scroll
- Row count is consistently < 100
- Server-side pagination is used
- Mobile is the primary target (pagination is more user-friendly)
Feature Selection Guide
Export (useTableExport)
Add export when:- Users need to share data externally (spreadsheets, reports)
- Compliance/audit requirements exist
- Data analysis workflows are common
- Always exclude
actionscolumn from exports - Use descriptive filenames with date context
- Show loading state for large exports
- Consider Excel for formatted data (headers, number formatting)
Column Pinning (useColumnPinning)
Pin columns when:- Tables have many columns requiring horizontal scroll
- Key identifiers (ID, name) should always be visible
- Action buttons should be accessible without scrolling
- Pin ID/identifier columns to the left
- Pin action columns to the right
- Limit pinned columns to 2-3 maximum
- Use persistence key for user preference retention
Row Grouping (useRowGrouping)
Use grouping when:- Data has natural categories (status, type, period)
- Aggregate values add insight (totals, counts, averages)
- Users need to focus on subsets of data
- Limit grouping to 1-2 levels
- Show aggregates that provide actionable insights
- Default to collapsed for large datasets
- Persist expanded state in localStorage
Inline Editing (useInlineEdit)
Use inline editing when:- Quick edits are common workflow
- Context switching (modals) slows users down
- Fields are simple (text, number, select)
- Complex validation is required
- Changes have significant side effects
- Audit trails need confirmation dialogs
Performance Best Practices
1. Always Use Pagination for Server Data
2. Memoize Column Definitions
3. Use Skeleton Loaders
4. Optimize Render Functions
Mobile Considerations
Responsive Table Patterns
-
Horizontal scroll (default)
- Works for most tables
- Add visual indicator for scrollable content
-
Column hiding
- Hide non-essential columns on mobile
- Use column visibility toggle
-
Card layout
- For data-dense tables
- Switch to vertical card layout on mobile
Touch Targets
Common Patterns
Filter + Table Pattern
Bulk Actions Pattern
Empty State Pattern
Anti-Patterns to Avoid
❌ Fetching All Data Client-Side
❌ Recreating Table Instance
❌ Complex Logic in Column Accessors
❌ Missing Loading States
References
- table-v2 README
- TanStack Table Migration Status
- TanStack Table Documentation