larowlan / vite-plugin-twig-drupal

Provides a vite plugin for rendering Drupal flavoured twig files with Storybook
MIT License
16 stars 6 forks source link

Storybook decorators #21

Closed hirnschmalz closed 2 months ago

hirnschmalz commented 3 months ago

Is there a way to make use of Storybooks decorators to wrap the component with some additional HTML code that should not be shown in the HTML view of Storybook?

larowlan commented 3 months ago

I don't see why not? Have you tried it and it didn't work? If so what errors did you get

hirnschmalz commented 2 months ago

Sorry, my fault - wrong code 🤦

Just in case anybody else is struggling. Decorators work like this

  decorators:[
    (Story) => `
      <div class="grid">
        ${Story()}
      </div>
    `,
  ],
larowlan commented 2 months ago

Nice! Thanks for replying 👍