-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Reset Button" option #10711
Comments
It's not clear what you mean by "reset to their original state" What is the "state"? The state of the buttons? (such as "return to line") or the state of the code block? (note: code blocks are usually stateless) Since you only link to MUI / Bootstrap landing pages, I'm not really able to see a concrete example. Can you link to an actual page/section instead please? Do you mean it's only for live playgrounds where you can edit the code block? Is the goal to "restore" the original code in that live playground? |
By "state," I mean the original code. If the user has modified the code, the "Reset" button would restore it to the original example provided.
For example, this page on MUI features a "Reset demo" option in the code example:
Yes, it’s specifically for live playgrounds where users can edit the code block. The goal is to provide an option to restore the original code. I hope I’ve addressed your questions. If anything is still unclear or if you need further details, let me know. |
Thanks, I understand now. Will need to think about it and see what to do for live playgrounds. There was also a related button placement improvement PR here: #10461 We may want to place the buttons similarly for the live playgrounds to ensure some kind of UI consistency |
Have you read the Contributing Guidelines on issues?
Description
Like the existing 'CopyButton,' a 'ResetButton' would be a valuable addition. This feature can be used by websites, such as React Bootstrap, to allow users to reset example codes to their original state."
Has this been requested on Canny?
No response
Motivation
This option is available on some websites, such as MUI, and it enhances user experience by allowing users to easily restore example code to its original state.
API design
Here’s a rough design of how the feature could look. I’ve taken a screenshot from React Bootstrap's code editor and edited it to illustrate the idea.
Have you tried building it?
No response
Self-service
The text was updated successfully, but these errors were encountered: