Data Display

DataTable

A world-class responsive data table with sorting, selection, pagination, and full accessibility. Designed for healthcare data where clarity and accuracy are critical.

Patient List with Selection

Display patient information with row selection for bulk actions. Select rows to enable actions.

Patient list with selection
Patient Name MRN Age Status Last Visit Insurance
Sarah Johnson2024-00123445 active2024-01-15Blue Cross
Michael Chen2024-00123562 active2024-01-20Aetna
Emily Rodriguez2024-00123678 critical2023-12-10UnitedHealth
David Kim2024-00123734 active2024-01-18Cigna
Maria Garcia2024-00123856 pending2024-01-22Medicare
James Wilson2024-00123941 active2024-01-19Blue Cross

Size Variants

Choose size based on data density needs. Use 'sm' for dense displays, 'lg' for comfortable scanning.

Small - Dense display

Small size appointments
Patient Date Type
Sarah Johnson2024-02-01Follow-up
Michael Chen2024-02-01Consultation
Emily Rodriguez2024-02-02Check-up

Large - Comfortable scanning

Large size appointments
Patient Date Type
Sarah Johnson2024-02-01Follow-up
Michael Chen2024-02-01Consultation
Emily Rodriguez2024-02-02Check-up

Lab Results with Row Highlighting

Highlight rows based on status for quick visual scanning. Critical values are highlighted in red, abnormal in yellow.

Laboratory test results
Test Value Unit Reference Status
Hemoglobin14.2g/dL12.0-17.5 normal
Glucose (Fasting)95mg/dL70-100 normal
Total Cholesterol245mg/dL<200 abnormal
Potassium6.2mEq/L3.5-5.0 ⚠ Critical
Creatinine1.1mg/dL0.7-1.3 normal

Sticky Header with Scroll

Keep headers visible when scrolling through large datasets. Essential for long patient lists.

Appointments with sticky header
Patient Date Time Type Status
Sarah Johnson2024-02-0110:00 AMFollow-up scheduled
Michael Chen2024-02-012:30 PMConsultation scheduled
Emily Rodriguez2024-02-029:15 AMCheck-up scheduled
David Kim2024-02-0211:00 AMLab Review completed
Maria Garcia2024-02-033:00 PMFollow-up cancelled
Sarah Johnson2024-02-0110:00 AMFollow-up scheduled
Michael Chen2024-02-012:30 PMConsultation scheduled
Emily Rodriguez2024-02-029:15 AMCheck-up scheduled
David Kim2024-02-0211:00 AMLab Review completed
Maria Garcia2024-02-033:00 PMFollow-up cancelled
Sarah Johnson2024-02-0110:00 AMFollow-up scheduled
Michael Chen2024-02-012:30 PMConsultation scheduled
Emily Rodriguez2024-02-029:15 AMCheck-up scheduled
David Kim2024-02-0211:00 AMLab Review completed
Maria Garcia2024-02-033:00 PMFollow-up cancelled

Pagination

Navigate through large datasets with pagination. Shows current position and total items.

Paginated patient list
Patient Name MRN Status Last Visit
Sarah Johnson2024-001234 active2024-01-15
Michael Chen2024-001235 active2024-01-20
Emily Rodriguez2024-001236 critical2023-12-10
David Kim2024-001237 active2024-01-18
Maria Garcia2024-001238 pending2024-01-22
James Wilson2024-001239 active2024-01-19
Showing 1 - 3 of 6
1 / 2

Loading State

Show skeleton placeholders while fetching data. Communicates system activity without blocking interaction.

Loading state demo
Patient Name MRN Status Last Visit
Sarah Johnson2024-001234active2024-01-15
Michael Chen2024-001235active2024-01-20
Emily Rodriguez2024-001236critical2023-12-10
David Kim2024-001237active2024-01-18

Empty State

Display helpful empty states when no data matches the current filters.

Default empty message

Patient Name Status

No patients found

Try adjusting your search criteria or filters.

Custom empty state

Patient Name Status

No results found

We couldn't find any patients matching your search. Try different keywords.

Props

PropTypeDefaultDescription
columns TableColumn<T>[]Column definitions (required)
data T[]Data rows (required)
caption stringTable caption for accessibility
captionHidden booleanfalseVisually hide caption (still accessible)
size 'sm' | 'md' | 'lg''md'Size variant for cell padding
sortState SortStateCurrent sort state
hoverable booleantrueWhether rows are hoverable
striped booleanfalseWhether rows are striped
stickyHeader booleanfalseSticky header when scrolling
maxHeight stringMax height for scrollable table
selectable booleanfalseEnable row selection
selectedKeys Set<string>Currently selected row keys
loading booleanfalseShow loading skeleton
loadingRows number5Number of skeleton rows
emptyMessage string'No data available'Empty state title
emptyDescription stringEmpty state description
getRowKey (row: T, index: number) => stringRow key function
cellRenderer SnippetCustom cell renderer
emptyState SnippetCustom empty state
onRowClick (row: T) => voidRow click handler
onSort (state: SortState) => voidSort change handler
onSelectionChange (keys: Set<string>) => voidSelection change handler
currentPage numberCurrent page (1-indexed)
pageSize numberItems per page
totalItems numberTotal items (server pagination)
onPageChange (page: number) => voidPage change handler
getRowHighlight (row: T) => string | nullRow highlight function

Healthcare Best Practices

  • Row Highlighting: Use getRowHighlight to visually distinguish critical values (abnormal lab results, urgent status).
  • Selection for Actions: Enable selectable for bulk operations like exporting records or batch updates.
  • Caption for Accessibility: Always provide a caption describing the table's purpose for screen reader users.
  • Sticky Headers: Use stickyHeader with maxHeight for long patient lists.
  • Pagination: Use pagination for datasets over 20-30 rows to improve load time and readability.
  • Loading States: Always show skeleton loading when fetching data to indicate system activity.
  • Hide on Mobile: Use hideOnMobile on non-essential columns to maintain readability on small screens.

Accessibility Notes

  • WCAG Compliance: Uses semantic HTML (<table>, <thead>, <tbody>, <th>) with proper scope attributes.
  • Sort Announcements: Uses aria-live region to announce sort changes to screen readers.
  • Keyboard Navigation: All interactive elements (sortable headers, clickable rows, selection) are keyboard accessible.
  • Focus Indicators: Clear focus rings on all interactive elements for keyboard navigation.
  • Loading State: Uses aria-busy to indicate loading state to assistive technology.
  • Selection State: Uses aria-selected to indicate selected rows.