How to use the @storybook/riot.asCompiledCode function in @storybook/riot

To help you get started, we’ve selected a few @storybook/riot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github storybookjs / storybook / examples / riot-kitchen-sink / src / stories / nested-tags.stories.js View on Github external
import { tag, mount, asCompiledCode } from '@storybook/riot';
import SimpleTestRaw from './SimpleTest.txt';
import './AnotherTest.tag';

const simpleTestCompiled = asCompiledCode(SimpleTestRaw);

export default {
  title: 'Story/Nest tags',
};

export const threeTags = () => ({
  tags: [
    'Simple titleSimple Content',
    '<h1></h1>',
    '<div style="border-radius: 1em;border-right: solid 1px #cac9c9;border-bottom: solid 1px #cac9c9;box-shadow: 1em 1em 2em #eae9e9; margin: 3em; padding: 3em;min-height: 10em;min-width: 30em"></div>',
  ],
});

threeTags.story = {
  name: 'Three tags',
};
github storybookjs / storybook / examples / riot-kitchen-sink / src / stories / story-code.stories.js View on Github external
import { tag, mount, storiesOf, asCompiledCode } from '@storybook/riot';
import SimpleTestRaw from './SimpleTest.txt';
import './AnotherTest.tag';

const simpleTestCompiled = asCompiledCode(SimpleTestRaw);

storiesOf('Story|How to create a story', module)
  .add(
    'built with tag',
    () =&gt;
      tag('test', '<div>simple test ({ opts.value })</div>', '', '', () =&gt; {}) &amp;&amp;
      mount('test', { value: 'with a parameter' })
  )

  .add('built as string', () =&gt; ({ tags: ['<div>simple test</div>'] }))

  .add('built from raw import', () =&gt; simpleTestCompiled)

  .add(
    'built from tags and template',
    () =&gt; ({

@storybook/riot

Storybook for riot.js: View riot snippets in isolation with Hot Reloading.

MIT
Latest version published 4 years ago

Package Health Score

64 / 100
Full package analysis