Editable Data Components

Ready

Interactive components for inline editing, task management, and financial data display.

EditableList

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

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

EditableCell

Click-to-edit cells with hover affordance, save/cancel controls, and validation feedback

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

EditableTable

Full table with inline editable cells, add/delete rows, and validation support

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
David Brown
Engineering
$105,000
2020-05-05

FinancialTable - Quarterly Report

Decimal-aligned columns, monospaced numerals, currency in header, with totals row

Quarter
Revenue(USD)
Expenses(USD)
Net Profit(USD)
Margin
Q1 2024125,000.5087,500.2537,500.2530.0%
Q2 2024142,000.7595,200.5046,800.2533.0%
Q3 2024138,500.0098,300.0040,200.0029.0%
Q4 2024156,000.25102,500.7553,499.5034.3%
FY 2024 Total561,501.50383,501.50178,000.00126.3

FinancialTable - Product Pricing

Compact density with product pricing and margins

Product
Price(USD)
Cost(USD)
Profit(USD)
Margin
Premium Plan29.9912.5017.4958.4%
Business Plan99.9945.0054.9955.0%
Enterprise Plan299.99125.00174.9958.3%
Starter Plan9.995.004.9949.9%
All Products439.96187.50252.46221.6

API Reference

Props and usage for editable data components

EditableList Props

PropTypeDefaultDescription
itemsEditableListItem[]requiredArray of list items
reorderablebooleanfalseEnable drag-to-reorder
checkablebooleantrueShow checkboxes
editablebooleantrueEnable inline editing

EditableTable Props

PropTypeDefaultDescription
columnsEditableTableColumn[]requiredColumn definitions with type, validation, formatting
dataT[]requiredArray of row data objects
onChangefunctionrequiredCallback when data changes
addablebooleanfalseShow add row button
deletablebooleanfalseShow delete row buttons
stripedbooleanfalseAlternate row background colors

EditableCell Props

PropTypeDefaultDescription
valuestring | numberrequiredCell value
typetext | number | email | url | datetextInput type
validatefunction-Validation function
formatfunction-Display formatter

FinancialTable Props

PropTypeDefaultDescription
columnsFinancialColumn[]requiredColumn definitions with currency
highlightNegativebooleantrueHighlight negative values in red
showTotalsbooleanfalseShow totals footer row
densitycompact | comfortable | spaciouscomfortableRow height density

Usage Examples

Code examples for implementing editable data components

// EditableList
import { EditableList } from '@/components/ui/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 '@/components/ui/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 '@/components/ui/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 '@/components/ui/financial-table'

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