Storybook: Knobs panel not displayed

Created on 14 Aug 2017  路  5Comments  路  Source: storybookjs/storybook

I am running a storybook instance and have the component displayed there, but knobs panel is not displayed. The source is very simple:

/* global module */
import React from 'react';
import { storiesOf } from '@storybook/react';
import { withKnobs, select } from '@storybook/addon-knobs';

import PhotoSlider, { ThemePreset, SliderType } from '../../index';

const stories = storiesOf('ThemedPhotoSlider', module);
stories.addDecorator(withKnobs);

const imageUrls = [
    'https://upload.wikimedia.org/wikipedia/commons/2/24/BLA_flag.jpg',
    'http://sw2773.smartweb-static.com/upload_dir/shop/Forside-Sydafrika.jpg',
    'https://hormozgan96.files.wordpress.com/2013/01/bla-flag.png',
];

stories.add('Flags', () =>
    <PhotoSlider
        sourceUrls={imageUrls}
        theme={select('Theme', ThemePreset, ThemePreset.Standard)}
        type={select('Type', SliderType, SliderType.ImagePerRow)}
    />,
);

No error is shown, console is clear of any messages, it displays the component with the default button text ('Ok'), but knobs panel is not visible anywhere to enable changing the button title.

What's strange, I use storybook at work, and the knobs panel is displayed there, but here on my computer at home, there is no knobs panel. So I know how these are used, I used text, number, boolean, etc. and it all works at work, but what ever I try I don't get the knobs panel here.

Here is a screen shot
https://ibb.co/hOVwcF

knobs question / support

Most helpful comment

Jesus, I just saw it on your knobs page as well. Completely my fault, sorry about the fuss. Sorry I did not take it seriously and did not read it thoroughly. Thanks Daniel for help, Closing.

2 years later I had the same issue. I didn't see the addon.js part. So this thread was helpful after all. Thanks.

All 5 comments

How does your .storybook/addons.js file look like?

It doesn't look. I don't have that file. I was reading through your pages about knobs, but I did not see any mention of that config file. Should you make any documentation about it more visible in relevant places? Now I see 'Using Addons' mentions it, but I didn't use your docs to read chronologically all content, but rather what I needed. I think you should make this more visible when reading e.g. about knobs.

Jesus, I just saw it on your knobs page as well. Completely my fault, sorry about the fuss. Sorry I did not take it seriously and did not read it thoroughly. Thanks Daniel for help, Closing.

Jesus, I just saw it on your knobs page as well. Completely my fault, sorry about the fuss. Sorry I did not take it seriously and did not read it thoroughly. Thanks Daniel for help, Closing.

2 years later I had the same issue. I didn't see the addon.js part. So this thread was helpful after all. Thanks.

This thread was indeed helpful as i did the exact same thing yesterday while setting up a new storybook repo

Was this page helpful?
0 / 5 - 0 ratings