Welcome to the Pingback Frontend Developer Challenge! In this project, you will create an embeddable form component for lead capture, similar to those used in email marketing platforms. This challenge is designed to test your skills in React, TypeScript, and modern frontend development practices.
- React
- TypeScript
- CSS (approach of your choice)
- Build tool of your choice (e.g., Webpack, Vite)
-
Embeddable Form Component
- Create a React component that can be compiled into a single JavaScript file for easy embedding in any website.
- The component should be customizable through HTML attributes.
-
Field Types
- Implement the following field types:
- Text input
- Dropdown (select)
- Textarea
- Implement the following field types:
-
Validation
- Include built-in validation for:
- Email addresses
- Phone numbers
- Allow fields to be marked as required or optional
- Include built-in validation for:
-
Customization
- Enable customization of field types and properties via HTML attributes
-
Styling
- Use CSS for styling (approach of your choice)
- Ensure the form is responsive and looks good on various screen sizes
- The final output should be a single JavaScript file that can be included in an HTML page.
- Users should be able to render the form by adding a custom element to their HTML, e.g.:
<pingback-form id="lead-capture"></pingback-form>
- Allow users to configure fields using data attributes, for example:
<pingback-form id="lead-capture" data-fields='[ {"name": "name", "type": "text", "label": "Full Name", "required": true}, {"name": "email", "type": "email", "label": "Email Address", "required": true}, {"name": "phone", "type": "tel", "label": "Phone Number", "required": false}, {"name": "role", "type": "select", "label": "Your Role", "options": ["Developer", "Designer", "Manager"], "required": true}, {"name": "message", "type": "textarea", "label": "Message", "required": false} ]' > </pingback-form>
- Implement client-side validation for all fields
- Display error messages for invalid inputs
- Ensure email and phone number fields have specific validation rules
- On form submission, collect all form data and log it to the console (in a real-world scenario, this would be sent to a server)
- Display a success message after successful submission
- Use CSS for styling (approach of your choice)
- Ensure the form is visually appealing and matches modern design standards
- Make the form responsive, working well on both desktop and mobile devices
- Set up a new React project with TypeScript support
- Choose and implement your preferred CSS approach
- Develop the form component according to the specifications above
- Set up a build process that compiles your React component into a single JavaScript file
- Create a sample
index.html
file demonstrating how to use the embedded form
- Source code for the React component
- Compiled JavaScript file for embedding
- Sample
index.html
file showing usage of the embed - Brief documentation on how to use and customize the form
Your submission will be evaluated based on:
- Code quality and organization
- Proper use of React and TypeScript
- Implementation of required features
- Validation and error handling
- Styling and responsiveness
- Build process and ease of embedding
- Create a GitHub repository for your project
- Push your code to the repository
- Include all necessary documentation in the README.md file
- Ensure your repository is public or provide access to reviewers
- Send the link to your repository to [email protected]
Good luck! We look forward to seeing your creative and technical solutions to this challenge.