CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/react-patterns

React patterns — always apply error boundaries, loading states, accessible markup, proper hooks, controlled forms, stable keys, and correct memoization

87

1.83x
Quality

80%

Does it follow best practices?

Impact

99%

1.83x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-1/

Sales Dashboard

Build a sales dashboard page in React with TypeScript. The page fetches sales data from /api/stats which returns { data: Stat[] } where each Stat has id: string, label: string, value: number, and trend: "up" | "down" | "flat".

Display the stats as a grid of cards. Each card shows the label, the formatted value (as USD currency), and an arrow icon indicating the trend direction.

Output

Produce TypeScript/TSX files in a src/ directory:

  • src/types.ts -- TypeScript type definitions
  • src/hooks/useStats.ts -- custom hook to fetch stats
  • src/components/StatCard.tsx -- individual stat card
  • src/components/Dashboard.tsx -- the dashboard page that uses the hook and renders cards
  • src/App.tsx -- the app entry point that renders the dashboard

The code does not need to run against a real server. Do not include test files or build configuration.

evals

scenario-1

criteria.json

task.md

tile.json