Skip to content
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

Make it possible to hide the default "clear" button in SandpackConsole #1043

Closed
1 of 2 tasks
LudoLogical opened this issue Nov 24, 2023 · 0 comments · Fixed by #1044
Closed
1 of 2 tasks

Make it possible to hide the default "clear" button in SandpackConsole #1043

LudoLogical opened this issue Nov 24, 2023 · 0 comments · Fixed by #1044
Labels
triage New issues that needs consideration

Comments

@LudoLogical
Copy link

Tell us how you think we can improve Sandpack

Title. It's possible to hide all of the default buttons in SandpackPreview thanks to props like showRefreshButton, but there is no equivalent for SandpackConsole. Notably, adding a custom button is already possible because, just like SandpackPreview, SandpackConsole accepts actionsChildren and the default button just invokes a function that is already exposed through a hook (specifically, useSandpackConsole's reset()).

Packages affected

  • sandpack-client
  • sandpack-react

What is this feature?

A new prop for SandpackConsole: showClearButton: boolean = false

How would your idea work?

When showClearButton is set to false (default), SandpackConsole renders as normal. When showClearButton is set to true, SandpackConsole does not render the circular button that, when clicked,

Do you have any examples of how you would like to see us implement it?

It should be a fairly straightforward addition to SandpackConsole, plus any desired testing and/or mocking.

Note: I am willing to submit a PR should one be desired! I just want to make sure that this feature request is seen as desired first.

@LudoLogical LudoLogical added the triage New issues that needs consideration label Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage New issues that needs consideration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant