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
| Field | Value |
|---|---|
| Name | John Doe |
john@example.com | |
| Salary | $85,000 |
EditableTable
Full table with inline editable cells, add/delete rows
| Name | Department | Salary | Start 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 2025 | 1,250 | 875 | 375 |
| Q2 2025 | 1,420 | 952 | 468 |
| Q3 2025 | 1,385 | 983 | 402 |
| Q4 2025 | 1,560 | 1,025 | 535 |
| FY 2025 Total | 5,615 | 3,835 | 1,780 |
Props
API reference for editable data components
EditableList Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | EditableListItem[] | — | Array of list items (required) |
onChange | (items: EditableListItem[]) => void | — | Change callback (required) |
reorderable | boolean | false | Enable drag-to-reorder |
checkable | boolean | true | Show checkboxes |
editable | boolean | true | Enable inline editing |
EditableTable Props
| Prop | Type | Default | Description |
|---|---|---|---|
columns | EditableTableColumn[] | — | Column definitions (required) |
data | T[] | — | Array of row data (required) |
onChange | (data: T[]) => void | — | Change callback (required) |
addable | boolean | false | Show add row button |
deletable | boolean | false | Show delete row buttons |
striped | boolean | false | Alternate row colors |
onAddRow | () => T | — | Factory function for new rows |
FinancialTable Props
| Prop | Type | Default | Description |
|---|---|---|---|
columns | FinancialColumn[] | — | Column definitions (required) |
data | T[] | — | Array of row data (required) |
highlightNegative | boolean | true | Highlight negative values in red |
showTotals | boolean | false | Show totals footer row |
totalsLabel | string | 'Total' | Label for totals row |
density | 'compact' | 'comfortable' | 'spacious' | 'comfortable' | Row height |
striped | boolean | false | Alternate 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 managementKeyboard Navigation
| Key | Action |
|---|---|
| Tab | Navigate between cells |
| Enter | Save cell edit |
| Escape | Cancel edit |
| Space | Toggle checkbox |
Notes
- Focus trapped in edit mode
- Validation errors announced
- Drag handle is keyboard accessible
- Delete confirmation provided