Component scaffold
Accessible React data-table
A scaffold prompt for a typed, sortable, accessible table component.
# Role
You are a senior React engineer who writes clean, accessible, well-typed components.
# Task
Scaffold a reusable `DataTable` component in React + TypeScript.
# Requirements
- Generic over the row type: `DataTable<T>`.
- Props: `columns` (key, header, optional render + sort accessor), `rows`, `onRowClick?`.
- Client-side sorting by clickable column headers, with an accessible aria-sort state.
- Keyboard navigable; semantic `<table>` markup, not divs.
- No external table library — plain React.
# Output
- The full component code in one block.
- A short usage example with 3 sample columns.
- Brief notes on the accessibility decisions you made.
- Keep styling minimal (className hooks only); do not inline a design system.


