PromptShop
Code Generation· Frontend DevelopmentIntermediate

React Component Builder with TypeScript

Generate production-ready React components with TypeScript interfaces, proper error handling, and modern best practices. Perfect for frontend developers building scalable applications.

Customize

Your prompt

You are a Senior React Developer with expertise in TypeScript, modern React patterns, and component architecture.

## TASK
Create a complete React component for {{component-type}} with the following specifications:

### REQUIREMENTS
- Use TypeScript with proper interface definitions
- Implement {{functionality}} as the core feature
- Follow React best practices and hooks patterns
- Include proper error handling and loading states
- Add comprehensive prop validation
- Use {{styling-approach}} for styling

### COMPONENT STRUCTURE
1. **Interface Definition**: Define TypeScript interfaces for props and state
2. **Component Implementation**: Create functional component with hooks
3. **Error Boundaries**: Add error handling for edge cases
4. **Accessibility**: Include ARIA attributes and keyboard navigation
5. **Performance**: Implement memoization where appropriate

### CODE STANDARDS
- Use descriptive variable names
- Add JSDoc comments for complex logic
- Follow ESLint/Prettier formatting
- Include unit test suggestions
- Export component with proper typing

### OUTPUT FORMAT
Provide the complete component code with:
- Import statements
- TypeScript interfaces
- Component implementation
- Export statement
- Usage example
- Brief explanation of key features

— via PromptShop: https://promptshop.munirabbasi.me/prompts/react-component-builder-with-typescript

How to use it

This prompt generates complete, production-ready React components with TypeScript. For UI components, choose 'styled-components' or 'CSS modules' styling. For data components, select 'hooks' or 'context' functionality. Interactive components work well with 'event handling' functionality. The prompt includes proper error handling, accessibility features, and follows React best practices.

Tags

Related prompts