Disabled State
How to use and style disabled checkboxes in React Checkbox Pro
Disabled State
Learn how to use and style disabled checkboxes in your application.
Example
This checkbox cannot be modified
Usage
Basic Disabled State
Disabled with Initial State
Disabled in Controlled Mode
Styling
The disabled state comes with default styling:
- Reduced opacity
- Not clickable (cursor: not-allowed)
- Grayed out appearance
- Disabled state is preserved in the tab order
Best Practices
- Use disabled state when:
- The action is not currently available
- User doesn't have permission
- Operation is pending or loading
- Provide clear indication why the checkbox is disabled:
- Use helper text to explain the reason
- Consider tooltips for additional context
- Maintain accessibility:
- Keep disabled elements in the tab order
- Provide appropriate ARIA attributes
- Consider alternatives:
- Hide the option if it's not relevant
- Use read-only state if appropriate