Creating Custom Components
When to Use
Building project-specific UI not in Radix/Bootstrap.
Steps
- Use CLI:
npx drupal-radix-cli component create my-component - Or create manually:
my_subtheme/components/my-component/ - Define metadata in
.component.yml - Build Twig following Bootstrap patterns
- Test in isolation before integrating
Common Mistakes
- Not following Bootstrap patterns → Radix ecosystem expects Bootstrap conventions
- Omitting
*_utility_classesprops → Users can't extend without overriding - Hardcoding colors/spacing → Use Bootstrap variables
See Also
- Tool: https://www.npmjs.com/package/drupal-radix-cli