-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Ability to rename Knobs / Actions Tab-Titles #6879
Comments
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook! |
Hi psi-4ward, you can rename the Tab title by acessing the addons object in your config. import addons from '@storybook/addons';
addons.elements.panel['storybookjs/knobs/panel'].title = 'Props';
addons.elements.panel['storybook/actions/panel'].title = 'Event'; |
actually this doesn't work for me at all i get an empty addons.elements object. PS - i am using storybook v5.2.1 |
wrapping assignment in |
This didn't work for me from the config.js file but did work from the addons.js file import addons from "@storybook/addons";
setTimeout(function() {
addons.elements.panel["storybookjs/knobs/panel"].title = "Props";
addons.elements.panel["storybook/actions/panel"].title = "Events";
}, 0); |
This is not such a good workaround and relies on runtime, i wish there was a proper config for this. |
yes, I'm sorry, I should've mentioned it, I did this in the addons.js file as well as you are |
Is there a way to rename Addons like Controls/Actions in new Storybook? |
@StanCreuna |
In recent versions of Storybook (I am on 6.5 alpha 48 currently) the workaround for changing the addon title changes slightly because the This changes the Storysource addon's title to "Raw Source":
|
@curtgrimes I just came across this problem, maybe you are looking for smth like this (from this PR #9095)?
|
@levaigabor This doesn't seems to work, the only way that seems to work is the "workaround" suggested above. In my case (trying to hide/remove a tab) i can't even use the suggested workaround, seems like the This is the only (ugly) way i managed to remove/hide a tab: // .storybook/manager.js
setTimeout(() => {
// removes the 'Code' tab from the panel
const {
['storybook/source-loader/panel']: sourceTab,
...restOfTabs
} = addons.elements.panel;
addons.elements.panel = restOfTabs;
}, 0); |
Would be cool to have the ability to use own title for
Knobs
andActions
tabs to make it more consistent with other frameworks like Vue:Props
andEvents
.If I look at the code it's hopefully not to difficult.
The text was updated successfully, but these errors were encountered: