How to label PIE form elements #1968
Replies: 1 comment 4 replies
-
|
Thanks for raising this! I am not very fond of prop drilling. It's messy and adds tech debt to keep interfaces in sync as components evolve. Slots might be my preferred approach, but as we've discussed in the past they are prone to misuse and often appear to lead to confusion for our consumers. Whilst I know I put forward the approach of sibling usage for I think on balance, despite me disliking prop-drilling, I'd go for baking the label into the component template and potentially utilising This certainly isn't a strong preference! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We currently label our form components in several different ways:
pie-checkbox) but the component styles the text.pie-form-label, e.g.,pie-checkbox-group).pie-form-labelinternally which has its own styling (e.g.,pie-textarea), andpie-form-label's props are populated through props on the parent element. This is also known as "prop drilling".pie-text-input), aiming to support linking the elements with attributes likeforandid.There may also be other ways that are possible but we aren't currently doing.
To have a consistent experience when using our components, we should agree on a single approach, making sure that the one we choose is accessible and easy for developers to work with.
Beta Was this translation helpful? Give feedback.
All reactions