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

Use Storybook with plain html patterns (Feature request) #2187

Closed
deporter opened this issue Oct 31, 2017 · 3 comments
Closed

Use Storybook with plain html patterns (Feature request) #2187

deporter opened this issue Oct 31, 2017 · 3 comments

Comments

@deporter
Copy link

I would love to see Storybook have an option to build a plain html based pattern library. This seems to work, but the focus is more on using it with React or Vue. I am using the React version with plain html instead of React components. I get an error in console saying it is expecting 'className' instead of 'class'. I assume this is due to React itself. Is there potential that there will be focus on having the ability to use plain html patterns in the future?

@danielduan
Copy link
Member

I'm gonna say probably not.

You could write your HTML and use dangerouslySetInnerHTML in react after you import your HTML files as strings though.
https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml

@Hypnosphi
Copy link
Member

Hypnosphi commented Nov 1, 2017

Actually, Storybook for Vue can be used as Storybook for plain HTML:

import { storiesOf } from '@storybook/vue';

storiesOf('MySnippets', module)
  .add('hello', () => ({
    template: `
      <div class="hello">
        <h1>Hello!</h1>
      </div>
    `
  }))

@deporter
Copy link
Author

deporter commented Nov 2, 2017

Thanks guys, I will try out the Vue approach.

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

3 participants