Storybook: [Question: Knobs] Examples for html

Created on 12 Dec 2019  路  3Comments  路  Source: storybookjs/storybook

Is your feature request related to a problem? Please describe.
Wondering if there are any example setups for knobs using @storybook/html. I only see documentation for React, Angular and Vue. Is it possible to add knobs to the html implementation, for example, a knob that changes the class name.

Describe the solution you'd like
Here is my current setup for reference. Not sure where to go from here.

import { storiesOf } from '@storybook/html';
import { withKnobs, text, boolean, select } from '@storybook/addon-knobs';
const stories = storiesOf('Storybook Knobs', module);

export default { title: 'Button' };

stories.addDecorator(withKnobs);

const label = 'Button';
const options = {
  Primary: 'btn-primary',
  Secondary: 'btn-secondary',
  Tertiary: 'btn-tertiary',
};
const defaultValue = 'Primary';
const value = text(label, defaultValue, groupId);
const selectButtonType = select(label, options, defaultValue, groupId);

stories.add('primary', () => (
  `<button class="btn-primary" type="button" id="primary-action-two">${value}</button>`
));
knobs html documentation inactive question / support

All 3 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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dependencies[bot] picture dependencies[bot]  路  142Comments

Olian04 picture Olian04  路  78Comments

Gongreg picture Gongreg  路  58Comments

maraisr picture maraisr  路  119Comments

aericson picture aericson  路  97Comments