Editable Data Components

Data Display
Forms

Interactive components for inline editing, task management, and metrics display.

EditableList

Task list with checkbox completion, hover actions, and drag-to-reorder

  • Complete project proposal
  • Review design mockups
  • Update documentation
  • Schedule team meeting

EditableCell

Click-to-edit cells with hover affordance and validation

FieldValue
Name
John Doe
Email
john@example.com
Salary
$85,000

EditableTable

Full table with inline editable cells, add/delete rows

NameDepartmentSalaryStart Date
Alice Johnson
Engineering
$95,000
2022-03-15
Bob Smith
Marketing
$75,000
2021-08-20
Carol White
Design
$82,000
2023-01-10

FinancialTable

Decimal-aligned columns with monospaced numerals and totals

Quarter
Tasks
Focus Hours
Efficiency
Q1 20251,250875375
Q2 20251,420952468
Q3 20251,385983402
Q4 20251,5601,025535
FY 2025 Total5,6153,8351,780

Props

API reference for editable data components

EditableList Props

PropTypeDefaultDescription
itemsEditableListItem[]Array of list items (required)
onChange(items: EditableListItem[]) => voidChange callback (required)
reorderablebooleanfalseEnable drag-to-reorder
checkablebooleantrueShow checkboxes
editablebooleantrueEnable inline editing

EditableTable Props

PropTypeDefaultDescription
columnsEditableTableColumn[]Column definitions (required)
dataT[]Array of row data (required)
onChange(data: T[]) => voidChange callback (required)
addablebooleanfalseShow add row button
deletablebooleanfalseShow delete row buttons
stripedbooleanfalseAlternate row colors
onAddRow() => TFactory function for new rows

FinancialTable Props

PropTypeDefaultDescription
columnsFinancialColumn[]Column definitions (required)
dataT[]Array of row data (required)
highlightNegativebooleantrueHighlight negative values in red
showTotalsbooleanfalseShow totals footer row
totalsLabelstring'Total'Label for totals row
density'compact' | 'comfortable' | 'spacious''comfortable'Row height
stripedbooleanfalseAlternate row colors

Usage

Import and implementation examples

// EditableList
import { EditableList } from '@/blocks/data-display/editable-list'

const [tasks, setTasks] = useState([
  { id: 1, text: 'Task 1', completed: false },
  { id: 2, text: 'Task 2', completed: true },
])

<EditableList
  items={tasks}
  onChange={setTasks}
  reorderable
  checkable
  editable
/>

// EditableCell
import { EditableCell } from '@/blocks/data-display/editable-cell'

<EditableCell
  value={userData.email}
  type="email"
  onSave={(value) => setUserData({ ...userData, email: String(value) })}
  validate={(value) => !String(value).includes('@') ? 'Invalid email' : null}
/>

// EditableTable
import { EditableTable } from '@/blocks/data-display/editable-table'

<EditableTable
  columns={[
    { key: 'name', label: 'Name' },
    { key: 'salary', label: 'Salary', type: 'number', align: 'right',
      format: (v) => `$${Number(v).toLocaleString()}` },
  ]}
  data={employees}
  onChange={setEmployees}
  addable
  deletable
/>

// FinancialTable
import { FinancialTable } from '@/blocks/data-display/financial-table'

<FinancialTable
  columns={[
    { key: 'quarter', label: 'Quarter', align: 'left' },
    { key: 'revenue', label: 'Revenue', decimals: 2 },
  ]}
  data={quarterlyData}
  showTotals
/>

Features

Built-in functionality

  • Inline editing: Click to edit any cell
  • Validation: Custom validation with error messages
  • Type support: Text, number, email, date inputs
  • Drag & drop: Reorder list items
  • Checkboxes: Task completion tracking
  • Add/delete rows: Dynamic table management
  • Totals row: Automatic sum calculations
  • Dark mode: Full dark mode support

Accessibility

Accessibility considerations

ARIA Attributes

Lists use proper ARIA listbox rolesTables use semantic table elementsEditable cells have proper focus management

Keyboard Navigation

KeyAction
TabNavigate between cells
EnterSave cell edit
EscapeCancel edit
SpaceToggle checkbox

Notes

  • Focus trapped in edit mode
  • Validation errors announced
  • Drag handle is keyboard accessible
  • Delete confirmation provided