How to use the @storybook/react/.storiesOf function in @storybook/react

To help you get started, we’ve selected a few @storybook/react 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 Amsterdam / amsterdam-styled-components / packages / asc-ui / src / components / CustomHTMLBlock / CustomHTMLBlock.stories.tsx View on Github external
import React from 'react'
import { storiesOf } from '@storybook/react/'
import CustomHTMLBlockStyle from './CustomHTMLBlockStyle'
import CustomHTMLBlock from './CustomHTMLBlock'

storiesOf('Atoms/CustomHTMLBlock', module)
  .addDecorator(storyFn => (
    <div style="{{">{storyFn()}</div>
  ))
  .add('default', () =&gt; (
    
      <h1>Hello</h1>
      <p>I am a paragraph</p>
    
  ))
  .add('with dangerouslySetInnerHTML', () =&gt; (
    Hello
        <p>I am a paragraph</p>
        `,
github Amsterdam / amsterdam-styled-components / packages / asc-ui / src / components / SearchBar / SearchBar.stories.tsx View on Github external
action(`text changed: ${searchText}`)
        }}
        onSubmit={() =&gt; {
          action(`button clicked: ${searchText}`)
        }}
        value={searchText}
      /&gt;
      <p>
        <span>Searching for:</span>
        {searchText}
      </p>
    
  )
}

storiesOf('Composed/SearchBar', module)
  .addDecorator(storyFn =&gt; (
    <div style="{{">{storyFn()}</div>
  ))
  .add('default', () =&gt; (
     {
        action('input changed')
      }}
      onSubmit={() =&gt; {
        action('input submitted')
      }}
    /&gt;
  ))
  .add('default controlled', () =&gt; )
  .add('menu version', () =&gt; (
github Amsterdam / amsterdam-styled-components / packages / asc-ui / src / components / LinkList / LinkList.stories.tsx View on Github external
import React from 'react'
import { storiesOf } from '@storybook/react/'
import LinkList from './LinkList'
import LinkListItem from './LinkListItem'

storiesOf('Atoms/LinkList', module)
  .addDecorator(storyFn =&gt; (
    <div style="{{">{storyFn()}</div>
  ))
  .add('default', () =&gt; (
    
      I am a ListLink!
      Another one
      
        A loooooong, very, very, very long link
      
      
        A file!
      
    
  ))
github Amsterdam / amsterdam-styled-components / packages / asc-ui / src / components / Editorial / Publication / Publication.stories.tsx View on Github external
import React from 'react'
import { storiesOf } from '@storybook/react/'
import { action } from '@storybook/addon-actions'
import {
  Container,
  Column,
  CustomHTMLBlock,
  Row,
  EditorialHeader,
} from '../../../index'
import DocumentCover from '../../DocumentCover'
import publicationJSON from './publication_feed.json'
import { EditorialMetaList, EditorialContent } from '../index'
import Paragraph from '../../Paragraph'

storiesOf('Composed/Editorial/Publication', module)
  .addDecorator(storyFn =&gt; (
    <div style="{{">{storyFn()}</div>
  ))
  .add('implementation for dataportal', () =&gt; {
    const {
      title,
      body,
      field_publication_intro: intro,
      field_file_size: fileSize,
      field_file_type: fileType,
      filecover_url: coverUrl,
      file_url: downloadUrl,
    } = publicationJSON

    return (