Checkbox Component
Contributed by Heran Wang
A checkbox component allows users to make a binary choice.
Basic Checkbox Component
Code Usage
Usability
-
Size: The size of the custom checkbox is made to be easily clickable but not overwhelmingly large. It's important to ensure that the checkbox is easily toggled by all users, including those with limited dexterity.
-
colour Contrast: The colours chosen for the checkbox provide sufficient contrast to ensure visibility for users with varying degrees of visual acuity.
-
Cursor Pointer: The cursor changes to a pointer when hovering over the checkbox, indicating an interactive element.
-
User Select: Text is set to be non-selectable, improving the checkbox interaction and reducing the likelihood of accidental text selection instead of checkbox toggling.
-
Font Size: The font size is not too small, ensuring readability.
Accessibility
-
Keyboard-Navigable: Since the checkbox is an HTML
<input>
element, it is natively keyboard-navigable, allowing for users with screen readers or those who rely on keyboard navigation to use the checkbox. -
colour Choices: While the colour contrast is generally good for users with reasonable vision, it's essential to note that relying solely on colour to convey information could be problematic for colour-blind users. However, in this case, the checkbox's state (checked/unchecked) is apparent due to the shape changes (the checkmark), not just colour.
-
Semantic HTML: The use of semantic HTML elements like
<label>
and<input>
aids screen readers and other assistive technologies in understanding the content and providing appropriate user interaction.
Version
Version | Editor | Author | Date | Description |
---|---|---|---|---|
v1.0 | Heran Wang | Heran Wang | 20/AUG/2023 | Initial version |
v2.0 | Heran Wang | Heran Wang | 27/AUG/2023 | Basic version |
v3.0 | Heran Wang | Heran Wang | 24/SEP/2023 | Enhanced version |
v3.1 | Heran Wang | Heran Wang | 01/OCT/2023 | Full version |
v3.2 | Heran Wang | Heran Wang | 02/OCT/2023 | Add innovative version |
v4.0 | Heran Wang | Heran Wang | 04/OCT/2023 | Verify updates |