Custom Styles
Learn how to use React Checkbox Pro without Tailwind CSS using built-in CSS classes
Custom Styles
React Checkbox Pro provides built-in CSS classes for styling when you're not using Tailwind CSS. This allows you to use the component in any project, regardless of your styling setup.
Example
Usage
To use the built-in CSS classes instead of Tailwind CSS:
- Set the
isWithoutTailwind
prop totrue
- Import the built-in CSS styles (optional if you want to use default styles)
Available CSS Classes
The following CSS classes are available for customization:
Customizing Styles
You can override the default styles by targeting the built-in classes:
With CSS-in-JS
You can also use the built-in classes with CSS-in-JS solutions:
Best Practices
-
CSS Organization:
- Keep custom styles in a separate CSS file
- Use specific selectors to avoid conflicts
- Follow BEM or similar naming conventions
-
Responsive Design:
- Use media queries for different screen sizes
- Adjust sizes and spacing accordingly
- Maintain touch targets on mobile
-
Accessibility:
- Maintain sufficient color contrast
- Keep focus styles visible
- Ensure proper sizing for touch targets
-
Performance:
- Minimize CSS specificity
- Use efficient selectors
- Avoid unnecessary nesting