Replies: 5 comments 6 replies
-
From a consumer perspective on the I certainly appreciate the perspective of keeping component props very specific such that the style is controlled and consistent. I'm generally in favor of more controlled as I think it makes the API surface of a component simpler to grok. It also lets the component props describe data/content and defer visual decisions to the Polaris/Design teams. I think that's better for future proofing Polaris, in general. In the end, I'm supportive of an opinionated framework/design and if a consumer wants more customization it's ok to require a custom component to be built by the end users. That's typically what we've done whenever we need to step outside of the constraints of a particular component. Having discussions like this is super helpful though! I love to see partners and Shopify devs collaborate on ideas for enhancing components. |
Beta Was this translation helpful? Give feedback.
-
I recently went through this journey. UX specified a clickable table cell with a two- or three-line label, with hard line breaks. For semantic and accessibility reasons, I wanted to use a At first (being new to Shopify and Polaris... and React) I tried a I rolled my own solution based on I then switched to a Like I said, it was a journey. In my case, being able to pass phrasing content as a child into |
Beta Was this translation helpful? Give feedback.
-
Glad I came across this discussion as I think about this a lot. In my case, I’ve run into the need of using ReactNode props to resolve accessibility concerns - returning the focus to the element activator. When a The problem with this is that it only works when a page has one secondary action. After having to add another action, it’s become an issue for us as consumers as we were on the crossroads of whether to build all the features we were getting from I now regret changing the |
Beta Was this translation helpful? Give feedback.
-
We came across this issue issue in the Notebooks app when we wanted to have an editable Notebook title but weren't able to do so using I personally like the flexibility of being able to pass in a The flip side of this flexibility is that users might do things that we don't anticipate or want to support in the design system. |
Beta Was this translation helpful? Give feedback.
-
May not be ideal but by keeping it string people can still get around it with It's still strongly suggested to use string but if a ReactNode is needed then it can be bypassed without changing the Polaris props when direly needed. |
Beta Was this translation helpful? Give feedback.
-
We often get requests on our components to allow React Elements to be passed to props rather than a specific prop type e.g.
string
Most of our components today have strong opinions about what props they expect. While we could make changes to component APIs ad hoc as requested, this is probably better solved by coming up with an opinion on our component APIs and composability.
Some recent examples of requests and components:
EmptyState and the passed image url prop
MediaCard component and the title prop
Tag
Button
Page
component andsubtitle
propBeta Was this translation helpful? Give feedback.
All reactions