EasyPrompt
Component scaffold

Accessible React data-table

A scaffold prompt for a typed, sortable, accessible table component.
Created from React component

Favorite this Prompt

Create an account to add this Prompt to Favorites in My Library.

react-table-scaffold.md184 tokens · 0.7 KB
# 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.

Make it yours

How would you like to customize “Accessible React data-table”?

Accessible React data-table — ready-to-use prompt - EasyPrompt