Checkbox
Enhance Choices with Stylish Checkboxes
Last updated
Enhance Choices with Stylish Checkboxes
Last updated
Our checkbox component is a user-friendly and visually intuitive UI element designed to enhance decision-making in your application or website. With a clear and straightforward design, it simplifies binary choices, making interactions smooth and engaging for users.
The checkbox features a small box with a checkmark or indicator representing its selected state. Accompanied by a label, users interact by clicking or tapping, toggling between selected and unselected states. Its simplicity makes it an effective UI element for binary choices.
Key properties like "checked" determine the checkbox state, while "disabled" prevents user interaction when activated. The "label" associates descriptive text, enhancing usability. Events such as "change" trigger dynamic responses to user actions, offering developers customization options for functionality and appearance in the interface.
Checked | Indeterminate | State | Size |
---|---|---|---|
True | True | Default | Small |
False | False | Hover | Medium |
Press | Large | ||
Error | |||
Require | |||
Read-only | |||
Disabled |
Default checkbox is the initial state when the checkbox is rendered, allowing users to make a conscious selection.
Checked checkbox indicates user affirmation or consent and is visually represented by a marked or filled checkbox.
Indeterminate checkbox represents a state where a checkbox's selection status is not explicitly checked or unchecked. It’s often used in scenarios where a checkbox group has a mix of selected and unselected items.
The checkbox supports various visual states, enhancing its adaptability.
Default checkbox is the standard appearance when not interacting.
Hover checkbox is the visual change that occurs when the user hovers over the checkbox
Press checkbox is the appearance when the user clicks or taps on the checkbox.
Read-only checkbox state ensures that users can view the checkbox state but cannot modify it.
Disabled checkbox state implies that the checkbox is not only non-interactive but also visually subdued to convey its inactive status.
The size property offers flexibility in design, allowing developers to choose from small, medium, and large checkboxes based on their application's aesthetic and layout preferences.
Error checkbox is the visual cue indicating an error state, often accompanied by an error message.
Required checkbox is s state emphasizing the mandatory nature of the checkbox, typically for required fields, with a distinct visual representation.
The Checkbox Group inherits essential properties from the Checkbox, offering seamless integration and consistent behavior. With two additional properties, vertical and horizontal, customization becomes effortless, allowing you to tailor the layout of your checkbox group according to your design preferences. The power lies in the ability to fine-tune the appearance of each checkbox within the group by leveraging the customizable properties inherited from Plus UI's Checkbox component.
The layout and spacing of checkbox components play a crucial role in user interface design. Proper alignment and spacing contribute to a visually organized and intuitive form, reducing clutter and enhancing user experience. Consistency in layout ensures that users can quickly identify and interact with checkboxes, creating a cohesive design.
Checkbox components should seamlessly adapt to both light and dark modes to enhance overall user experience. Considerate color choices and contrast adjustments are essential for maintaining visibility and readability in different lighting conditions. Ensuring a harmonious transition between modes allows users to comfortably engage with checkboxes regardless of the interface's overall theme.
Accessibility is paramount in checkbox component design, aiming to make them usable for everyone, including individuals with disabilities. This involves providing clear labels, employing proper focus indicators, ensuring keyboard navigation, and utilizing ARIA roles. By prioritizing accessibility, designers contribute to an inclusive digital environment where all users can engage with checkbox components effortlessly.
Criteria | Description | Status |
---|---|---|
ARIA Hidden Elements | Ensures aria-hidden elements are not focusable nor contain focusable elements | ✔️ Passed |
Inline Text Spacing | Ensure that text spacing set through style attributes can be adjusted with custom stylesheets | ✔️ Passed |
ID’s of active elements | Ensures every id attribute value of active elements is unique | ✔️ Passed |
ID Attribute | Ensures every id attribute value is unique | ✔️ Passed |
Discernible Text | Ensures links have discernible text | ✔️ Passed |
Tabindex Attribute | Ensures tabindex attribute values are not greater than 0 | ✔️ Passed |
Color Contrast | Ensures the contrast between foreground and background colors meets WCAG 2 AA contrast ratio thresholds. | ✔️ AA ~ AAA |
Property | Description | Type | Default |
---|---|---|---|
label | Label of the checkbox |
| - |
name | Name of the checkbox |
| - |
value | Value of the checkbox |
| - |
required | Whether the checkbox is required |
|
|
disabled | Whether the checkbox is disabled |
|
|
readonly | Whether the checkbox is readonly |
|
|
checked | Whether the checkbox is checked |
|
|
indeterminate | Whether the checkbox is indeterminate |
|
|
plus-change | Emitted when the checked property changes |
| - |