In this challenge, you will build a versatile checkbox component as part of a design system. These components will be essential for adding context to elements across various projects and apps found within the platform.
Component states, variants, and properties
- Value states: Support unchecked, checked, and indeterminate states. Note that indeterminate states are not natively supported by HTML attributes, JavaScript will be required.
- Interaction States: Implement and style the component to reflect different states – initial/default, focused, and disabled.
Implementation requirements
- Design fidelity: Aim to follow the design as closely as possible. All elements in the design should be present, using the specified text color, font size, font weight, spacing, dimensions, etc.
- Toggling between states: By default, clicking on checkboxes will only toggle between checked and unchecked states. The indeterminate state is activated via JavaScript.
- Cross-browser compatibility: Check that your solution works for major browsers including Chrome, Firefox, and Safari.
- [Stretch goal] Performance optimization: Optimize image assets and code for quick load times, ensuring a smooth and responsive user experience.
- [Stretch goal] Accessibility and semantics: Follow best practices for web accessibility, such as using semantic HTML and ARIA roles where necessary and using proper
alt
tags for images.