Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

How can the knobs panel be configured to appear on the right? #29

Closed
kevinSuttle opened this issue Sep 15, 2016 · 4 comments
Closed

How can the knobs panel be configured to appear on the right? #29

kevinSuttle opened this issue Sep 15, 2016 · 4 comments

Comments

@kevinSuttle
Copy link

kevinSuttle commented Sep 15, 2016

Mine is always on the bottom.

I know you can use the &panelRight=1&downPanel=kadirahq%2Fstorybook-addon-knobs URL params, but that gets pretty tedious copy and pasting.

@arunoda
Copy link
Contributor

arunoda commented Sep 16, 2016

We've a shortcut for that. 'CMD' + 'SHIFT' + 'J'.
Anyway, we should have a way to set these options manually which we are configuring it.
(This should go into the main storybook repo).

@roonyh do you know a easy way we can allow to set default URL params or some config stuff to make these options by default?

@usulpro
Copy link
Member

usulpro commented Sep 16, 2016

I think it is desirable to have such settings for each individual item of the storybook, And we need to setup a layout and selected tab. maybe something like this?

import { layout } from 'storybook-addon-layout';

stories.add('button callbacks', () => {
  /* adjust for working with actions  */
  layout({ panelRight: 0, downPanel: 'kadirahq/storybook-addon-actions/actions-panel' })
  <button
    onClick={action('click')}
  />
});

stories.add('button props', () => {
  /* adjust for working with knobs */
  layout({ panelRight: 1, downPanel: 'kadirahq/storybook-addon-knobs' })
  <button
    text={text('label', 'press me')}
  />
});


@thani-sh
Copy link
Contributor

The "Storybook options" addon can be used here. Check:
https://github.com/kadirahq/storybook-addon-options

It can be used the way similar to how @usulpro has mentioned or it can be used globally.

@thani-sh
Copy link
Contributor

For the initial problem, here's an example:

import { setOptions } from '@kadira/storybook-addon-options';
setOptions({ downPanelInRight: true });

This can be added to the config.js file to set it when Storybook initially loads. setOptions can also be called inside individual stories, inside decorators, etc.

I'll close this issue. Please re-open if there's anything else

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants