Component Override Patterns
When to Use
Modifying Radix base component for sub-theme.
Steps
- Copy component from Radix to sub-theme:
cp -r themes/contrib/radix/components/card themes/custom/my_subtheme/components/ - Modify
.component.ymlif adding/changing props - Update Twig template (preserve Bootstrap classes, ARIA attributes)
- Add component CSS/JS (auto-loads with component)
- Clear cache:
drush cr
Common Mistakes
- Removing base props → Keep for compatibility
- Not preserving accessibility → Maintain ARIA attributes
- Global CSS instead of component files → Component CSS loads only when needed