-
Wondering why I can't add |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I have same case and I solve it by wrapping anything you want to add padding in Box with asChild prop, so that padding are added to child, example:
asChild prop solved a lot of this and other case, basically when you want to pass anything to any component, example flex, grid, etc.. |
Beta Was this translation helpful? Give feedback.
-
The layout props like padding are available specifically on layout components in order to facilitate easier spacing and sizing for run-of-the-mill elements that don't deserve to be named or componentised. However, styling custom components is much more complex, especially when it comes to the interactive components like Accordion. No set of props would be sufficient to style things like that end-to-end without a full-blown styling solution. I'd suggest you use your favourite styling tech when building custom components; see more in the docs: |
Beta Was this translation helpful? Give feedback.
The layout props like padding are available specifically on layout components in order to facilitate easier spacing and sizing for run-of-the-mill elements that don't deserve to be named or componentised.
However, styling custom components is much more complex, especially when it comes to the interactive components like Accordion. No set of props would be sufficient to style things like that end-to-end without a full-blown styling solution.
I'd suggest you use your favourite styling tech when building custom components; see more in the docs:
https://www.radix-ui.com/themes/docs/overview/styling