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

Option to hide the action logger #192

Closed
clauderic opened this issue May 11, 2016 · 15 comments
Closed

Option to hide the action logger #192

clauderic opened this issue May 11, 2016 · 15 comments

Comments

@clauderic
Copy link

Is there an option to hide the action logger?

@arunoda
Copy link
Member

arunoda commented May 12, 2016

Yes. That's via keyboard shortcuts.
See this post: https://voice.kadira.io/power-tools-for-react-storybook-d404d7b29b82#.6br0o4xb0

@arunoda arunoda closed this as completed May 12, 2016
@clauderic
Copy link
Author

Sorry, should've been more specific. I meant is there a way to permanantly disable it from a configuration perspective, not at runtime. I'd love to use that area to display code examples instead, since my app doesn't use Redux

I read this section about customizing the UI https://github.com/kadirahq/react-storybook/blob/master/docs/configure_storybook.md#customizing-the-ui, but it links to a dead file https://raw.githubusercontent.com/kadirahq/react-storybook/master/src/client/ui/layout.js

@arunoda arunoda reopened this May 12, 2016
@arunoda
Copy link
Member

arunoda commented May 12, 2016

Ah okay. That's a nice feature.

@arunoda
Copy link
Member

arunoda commented Sep 15, 2016

You can simply remove it via our custom addons.js file.

Or you can hide it by adding down=0 query parameter.
See: http://kadira-samples.github.io/react-button/?down=0

@arunoda arunoda closed this as completed Sep 15, 2016
@itsravenous
Copy link

Just to clarify, because it wasn't clear to me:

You can simply remove it via our custom addons.js file.

This means adding an addons.js file in your .storybook folder. This will disable the loading of the default addons. If, like me, you want the links addon (which is one of the defaults) but not the action logger, just install @kadira/storybook-addon-links separately and import it in your addons.js file:

import '@kadira/storybook-addon-links/register';

@Bjvanminnen
Copy link

I've added an empty addons.js file to my .storybook folder, and I no longer get the action logger, but I still have a down panel that just states "No Panels Available". It seems the down panel should just be hidden in this case?

Is there any way to make it so that the down panel is hidden by default? Ideally I wouldn't have to add a query param every time to hide it.

@usulpro
Copy link
Member

usulpro commented Mar 23, 2017

@mrchief
Copy link

mrchief commented Jan 29, 2018

https://github.com/storybooks/storybook-addon-options

This is great except for this:

It is also possible to call setOptions() inside individual stories. Note that this will bring impact story render performance significantly.

@Hypnosphi
Copy link
Member

@mrchief Why not use it globally (in config.js)?

@mrchief
Copy link

mrchief commented Jan 29, 2018

@Hypnosphi I'm trying to create a storybook where some of the stories will need the action panel. While some are simply CodeSandbox embeds. For those, I would like to claim the whole screen area and so would disable the action panel completely.

You can see it here: https://github.com/dowjones/react-dropdown-tree-select/tree/storybook

@jamesarmenta
Copy link

jamesarmenta commented Nov 7, 2019

For posterity: This is now possible by configuring options in addParameters:

addParameters({
  options: {
      ...
      showAddonPanel: false
      ...
  }
});

See https://github.com/storybookjs/storybook/tree/master/addons/options for more details

@kriskate
Copy link

kriskate commented Jan 9, 2020

For posterity: This is now possible by configuring options in addParameters:

while that is technically true, you will need to add showAddownPanel: true option for all the stories that actually need the addons panel, as setting it to false in any story will hide it for all the stories

@shilman
Copy link
Member

shilman commented Jan 9, 2020

@kriskate if that's the case, you should be able to set it globally to true, since parameters cascade. (haven't tested for this specific case, but am certain cascading works)

@kriskate
Copy link

kriskate commented Jan 10, 2020

thanks @shilman , just tried doing so and it works. I've set showAddonPanel: true as global in config.js, and in the story I don't want it to be shown, as false.

The only inconvenience right now is that in order for this to work, you have to write your stories the old fashioned, non-exports way:

// works, hides the panels
storiesOf("Modal", module)
  .addParameters({ options: { showAddonPanel: false } })
  .add("Open Modal", () => <ModalBody />);


// doesn't work, the panels are shown
storiesOf("Modal", module).addParameters({ options: { showAddonPanel: false } });
export const OpenModal = () => <ModalBody />;

LE: Taken from #9175 (comment)
This works:

// global addParameters - showAddonPanel: true


/* *.stories.tsx */

export const OpenModal = () => <ModalBody />;
OpenModal.story = {
  parameters: { options: { showAddonPanel: false } },
};

@tmsss
Copy link

tmsss commented Apr 9, 2021

For future reference, you can remove the actions tabs globally in main.js like this:

module.exports = {
  ...
  "addons": [
    {
      name: '@storybook/addon-essentials',
      options: {
        actions: false,
      },
    },
  ],
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests