@storybook/react/types-6-0#Story TypeScript Examples

The following examples show how to use @storybook/react/types-6-0#Story. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.stories.tsx    From plug-react with MIT License 6 votes vote down vote up
WithSuspense: Story<Omit<PersonalizationProps<string>, 'expression'>> = args => (
    <Suspense fallback="✨ Personalizing content...">
        <Personalization {...args} expression="location's city">
            {(city: string) => (
                <NewsWidget city={city} />
            )}
        </Personalization>
    </Suspense>
)
Example #2
Source File: Breadcrumbs.stories.tsx    From gio-design with Apache License 2.0 6 votes vote down vote up
Default: Story<BreadcrumbsProps> = (args) => (
  <Breadcrumbs {...args}>
    <Link prefix={<HomeOutlined size="14px" />} href="/?path=/story/upgraded-breadcrumbs--default">
      Home
    </Link>
    <Link href="/?path=/story/upgraded-breadcrumbs--default">Second</Link>
    <span>Current</span>
  </Breadcrumbs>
)
Example #3
Source File: Header.stories.tsx    From WEB_CodeSquare_AmongUs with MIT License 6 votes vote down vote up
Template: Story<HeaderProps> = (args) => (
  <MemoryRouter>
    <div
      css={css`
        padding: 8px;
        background: #c4c4c4;
      `}
    >
      <Header {...args} />
    </div>
  </MemoryRouter>
)
Example #4
Source File: Button.stories.tsx    From Nishan with MIT License 5 votes vote down vote up
Template: Story<ButtonProps> = (args) => <Button {...args} />
Example #5
Source File: Header.stories.tsx    From frontend with GNU General Public License v3.0 5 votes vote down vote up
Template: Story<IAttributes<HTMLDivElement>> = (
  props: IAttributes<HTMLDivElement>
): JSX.Element => <Header {...props} />
Example #6
Source File: Avatar.stories.tsx    From ChatUI with MIT License 5 votes vote down vote up
Template: Story<AvatarProps> = (args) => <Avatar {...args} />
Example #7
Source File: ParameterMetadata.stories.tsx    From json-schema-viewer with Apache License 2.0 5 votes vote down vote up
Template: Story<ParameterMetadataProps> = (args) => <ParameterMetadata {...args} />
Example #8
Source File: index.stories.tsx    From plug-react with MIT License 5 votes vote down vote up
WithInitialState: Story<Omit<PersonalizationProps<string, null>, 'expression'>> = args => (
    <Personalization {...args} expression="location's city">
        {(city: string|null) => (
            <NewsWidget city={city} />
        )}
    </Personalization>
)