Table

A Table component is a structured UI element that organizes and displays data in rows and columns, making it easy to read and compare information. Tables can include features like sorting, filtering, pagination, and inline editing, allowing users to interact with the data efficiently. They are commonly used to present datasets, such as user information, product listings, or any structured content that benefits from a grid-like layout.
# Demo

Basic Table

Simple table with basic columns and data display for invoices and transactions.

Basic invoice table
InvoiceStatusMethodAmount
INV-001PaidCredit Card$1,250.00
INV-002PendingBank Transfer$750.50
INV-003OverduePayPal$2,100.00
INV-004PaidCredit Card$890.25

Enhanced Table with Custom Components

Table with custom cell renderers including status badges and action buttons for better interactivity.

Enhanced invoice table with custom components
InvoiceStatusPayment MethodAmountActions
INV-001PaidCredit Card$1,250.00
INV-002PendingBank Transfer$750.50
INV-003OverduePayPal$2,100.00
INV-004CancelledCredit Card$890.25
INV-005PaidStripe$1,500.75

User Management Table

Comprehensive user management table with avatars, roles, and status indicators.

User management table
UserRoleDepartmentStatusLast LoginActions
J
John Doe
john@example.com
AdminEngineeringActive2 hours ago
J
Jane Smith
jane@example.com
ManagerMarketingActive1 day ago
B
Bob Johnson
bob@example.com
DeveloperEngineeringInactive1 week ago
A
Alice Brown
alice@example.com
DesignerDesignActive30 minutes ago

Product Catalog Table

Product listing table with ratings, pricing, and inventory management features.

Product catalog table
Product NameCategoryPriceRatingStockActions
Wireless HeadphonesElectronics$99.99
(4)
25
Smart WatchWearables$299.99
(5)
12
Laptop StandAccessories$49.99
(3)
8
USB-C CableCables$19.99
(4)
50

Project Progress Table

Project management table with progress bars, deadlines, and team information.

Project progress table
Project NameTeam LeadProgressDeadlineStatusActions
Website RedesignSarah Wilson
75%
2024-02-15In Progress
Mobile AppMike Chen
45%
2024-03-01In Progress
API IntegrationDavid Kim
90%
2024-01-30Nearly Complete
Database MigrationLisa Garcia
100%
2024-01-15Completed

Compact Table

Compact table design for displaying essential information in limited space.

Compact user table
IDNameEmailStatus
001John Doejohn@example.comActive
002Jane Smithjane@example.comInactive
003Bob Johnsonbob@example.comPending

Striped Table

Table with alternating row colors for better readability and visual separation.

Striped table for better readability
InvoiceStatusMethodAmount
INV-001PaidCredit Card$1,250.00
INV-002PendingBank Transfer$750.50
INV-003OverduePayPal$2,100.00
INV-004PaidCredit Card$890.25

Responsive Table

Table with responsive design that adapts to different screen sizes with horizontal scrolling.

Responsive table with horizontal scroll
InvoiceStatusPayment MethodAmountActions
INV-001PaidCredit Card$1,250.00
INV-002PendingBank Transfer$750.50
INV-003OverduePayPal$2,100.00
INV-004CancelledCredit Card$890.25
INV-005PaidStripe$1,500.75

Table Best Practices

✅ Do's

  • • Use clear, descriptive column headers
  • • Implement proper sorting and filtering
  • • Provide visual feedback for actions
  • • Use consistent alignment (numbers right-aligned)
  • • Include loading states for async data
  • • Make tables responsive on mobile devices
  • • Use zebra striping for better readability
  • • Provide accessible table captions

❌ Don'ts

  • • Don't overcrowd tables with too many columns
  • • Don't use tables for layout purposes
  • • Don't forget to handle empty states
  • • Don't make action buttons too small
  • • Don't ignore keyboard navigation
  • • Don't use inconsistent data formatting
  • • Don't forget pagination for large datasets
  • • Don't neglect mobile responsiveness

Table Action Summary

Recent Table Actions

No actions performed yet. Try clicking on action buttons in the tables above.

# Usage
# Attributes
NameTypeDefaultDetails
classNamestring' 'You can customise by passing tailwind classes.
captionClassNamestring' 'You can customise by passing tailwind classes.
headerClassNamestring' 'You can customise by passing tailwind classes.
headerRowClassNamestring' 'You can customise by passing tailwind classes.
headerCellClassNamestring' 'You can customise by passing tailwind classes.
bodyClassNamestring' 'You can customise by passing tailwind classes.
bodyRowClassNamestring' 'You can customise by passing tailwind classes.
bodyCellClassNamestring' 'You can customise by passing tailwind classes.
captionstringOptionalCaption for the table.
columnsNTableColumn<T>[]RequiredArray of table columns.
dataT[]RequiredArray of table data.
tablePropsReact.TableHTMLAttributes<HTMLTableElement>OptionalProps for table element.
rowProps(row: T, rowIndex: number) => React.HTMLAttributes<HTMLTableRowElement>OptionalFunction to get row props.
cellProps(row: T, col: NTableColumn<T>, rowIndex: number, colIndex: number) => React.TdHTMLAttributes<HTMLTableCellElement>OptionalFunction to get cell props.