How to pass props from parent to child component? #1575
-
Maybe I'm missing something, but what are my options to pass a prop to a child component via its parent when using Panda? This doesn't work (due to property renaming, I believe):
I know custom variants or even utilities can be created, but that feels like a lot of work if you want to cover all cases (pt, pb, pr, pl, px, py, etc.), especially if eg. I also wanted to pass additional props such as a border. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
you can't rename css properties due to static limitations, see https://panda-css.com/docs/guides/dynamic-styling#property-renaming what you can do instead: https://play.panda-css.com/1tnhBY14qG |
Beta Was this translation helpful? Give feedback.
-
You can also use the special https://play.panda-css.com/JjXzPoYWuI cc @astahmer |
Beta Was this translation helpful? Give feedback.
You can also use the special
css
prop which panda automatically understandshttps://play.panda-css.com/JjXzPoYWuI
cc @astahmer