React Component Development Assignment
Submission by Thotakura Sanjana Snigdha
Tech: React · TypeScript · TailwindCSS · Storybook
Deliverables
• Two working components: InputField, DataTable
• Simple demo via Storybook stories
• Documentation: README with setup & deployment instructions
Screenshots (Mock UI captures)
InputField — Default
InputField — Password Toggle
InputField — Error State
DataTable — Default
DataTable — Sorted (Age)
DataTable — Selectable (Row selected)
Full code: src/components/[Link]
// src/components/[Link] not found (zip missing)
Full code: src/components/[Link]
// src/components/[Link] not found (zip missing)
Full code: stories/[Link]
// stories/[Link] not found (zip missing)
Full code: stories/[Link]
// stories/[Link] not found (zip missing)
Full code: tests/[Link]
// tests/[Link] not found (zip missing)
Full code: tests/[Link]
// tests/[Link] not found (zip missing)
Full code: [Link]
// [Link] not found (zip missing)
Full code: [Link]
// [Link] not found (zip missing)
Summarized Code Snippets
InputField highlights:
- Controlled/uncontrolled support via value prop and internal state.
- Variants: filled, outlined, ghost implemented with Tailwind utility classes.
- Sizes: sm, md, lg mapped to padding & font-size.
- Accessibility: aria-invalid, aria-describedby for helper/error text.
- Optional clear button and password toggle with internal state.
DataTable highlights:
- Generic typing with Column<T> and DataTableProps<T>.
- Sorting implemented via state (sortKey, sortAsc) and [Link].
- Row selection tracked with a Set of ids; onRowSelect callback provided.
- Loading and empty states included.
- Responsive container using overflow-x-auto.
Approach & Notes
- TypeScript for type safety and clearer props.
- TailwindCSS for utility-first styling.
- Storybook for interactive documentation.
- Vitest + Testing Library for unit tests.
How to run locally:
1. Unzip project folder.
2. npm install
3. npm run storybook (open [Link]
4. npm run test
5. To deploy Storybook: npm run build-storybook and deploy the storybook-static folder or use Chromatic.
Final Submission Links (placeholders)
GitHub Repository: [Link]
Storybook Preview Link:
Screenshots included are mock UI captures. Replace with real Storybook captures for final submission if available.