[docs] Break up TextField demos#17483
Conversation
|
No bundle size changes comparing c8176bb...da8541f |
|
Currently trying to tidy up the text field demos, as part of this and #17643 we should probably move the select demos from TextField completely and link to the actual select page. Although I'm not sure how clean having the select prop is. |
bc1ebec to
778ba33
Compare
|
cc @mbrookes Just for visibility - Still changing things though :) |
|
Still need to add the Select demos back |
|
Looking good so far. A few random thoughts:
|
34e0268 to
85699a8
Compare
|
@mbrookes
I’m interested in what everyone else thinks. I’m not sure if we even need an interactive demo since it will just add to the duplication. |
|
TBH I don't know what designers prefer. If I see screenshots from design systems these days it's mostly each combination next to each other. For a designer it might be more helpful to have a fully customizable (a But material.io also has an interactive demo now so this seems fine as a starter. I would only question the use of tabs for variants. Have you considered moving those to the left as a radio group? Basically mirroring the options but on the left. |
@eps1lon Interesting insight! I think that it supports the idea that humans prefer to move the eye and scroll rather than click to trigger actions. I personally find the cognitive overhead higher when I have to click on something vs scrolling. I think that it's an argument for more small demos instead of a playground/showcase.
I'm curious, why do you guys think they have such an interactive demo? The main value I see in it, for them is: "look, guys, we have this implemented, you can use it, today" and a bonus point for being compact, leaving space for the specification sections. I don't think that it's a problem we are facing. In our case, I think that the playground is interesting when there are too many props permutation we can demonstrate in small demos. I believe looking at the existing playground highly part of their interest. We have added them, along the way to solve the problem we were facing, at different points in time. I don't think that we had a global strategy, a master plan. But now, as we have this past history of solved problems, we can, with hindsight, look at them and think: "OK, so what makes good usage of the playground, when did we add them, can we find common patterns?" I think that I have answered part of it in the first paragraph. What do you guys think? |
Agreed - see my comments about wanting to at least keep a demo of the key features of each variant to avoid having to click around in the playground to see the component variants. I like the idea (Bootstrap style) of having the demo side-by-side with just the essential code snippet that only shows the component and the props that affect its appearance / behaviour: <TextField label="Email address" placeholder="[email protected]" />The show-code button could still be used to see the full worked example with imports, callback logic etc. |
Same feeling. It's great not to have to click on the show code button and not to have to dig in the sources to find the correct props to apply. You scroll, you evaluate, you copy. End of story. However, it won't work with all the demos. Some are too complex. We could look at the % of demos we have that could benefit from such an approach. If this figure is high enough (to be defined) it could make sense to invest time in it. Sebastian has done an effort in this direction a few months ago. He has added support for a source panel open by default. It has helped. |
Agreed. I had the words "for those that are simple enough" in my comment, and edited down for brevity.
Yeah, that's super useful where the code sample is the primary concern, and the output is secondary. For this though, it's a minimal subset of the code used to render the demo. "Show source" is still useful to see the full code sample, but the default view is the bare essentials. |
|
So based on everyone's feedback. I think we should take the following steps:
|
@joshwooding I think that this change (and it's possible developments) alone is valuable 👍. I hope it will answer the problem reported by the users: struggle to find the source / too large demos.
It depends on the objective, what problem(s) do we solve?
@mbrookes I have found the following projects that explore this space (I mention the diffs with us, I have ignored the libs that do it like us, e.g. fabric, atlaskit):
|
|
So to summarise:
For those that don't display the full code, all show just the content of the render method, but Chakra also shows the full component function if it contains assignments used in the render method. |
|
@mbrookes Do you have a preference for each of these dimensions? (our benchmark isn't comprehensive) Which one would improve the UX? |
e2ac5c6 to
a1ee0af
Compare
|
"Bye TextFields you will be missed." Uh, nope! 😄 |
594baa3 to
784168a
Compare
oliviertassinari
left a comment
There was a problem hiding this comment.
I think that it's already significantly better. In the future I think that we should try to remove the class names we apply directly on the demoed elements. It uses space and require to be removed when copy and paste. We have started to do it for having better code previews under the demo. I'm eager to push it further.
|
👌 |
Finally back in business 🎉
Preview: https://deploy-preview-17483--material-ui.netlify.com/components/text-fields/